Perl screencast? [closed] - perl

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I need to learn Perl for an academic research I am doing. I need to go through a lot of older perl scripts and run them, tweak some perl scripts from open source tools for my use and of course make some of my own.
I have a tight schedule so I needed to be comfortable with a perl code pretty quickly. I have previous coding experience from C and Java but not with any scripting languages as such. I found Perl to be quite difficult to get used to from the beginner tutorials I have gone across. I am more comfortable learning through screencasts rather than go through books when I start learning languages. Of course one always needs a good reference book or user manual but videos are more intuitive when learning something first especially because I can see the expert actually code stuff and explain it at the same time.
I've heard from other friends that there are great screencasts for other scripting languages like Ruby and Python. I was wondering is there any really good quality screencast for Perl out there. So, I ask for help from people who have good experience with Perl to point me to a good resource.

I don't think that screencasts are really that valuable in terms of learning fast and deep. There are some nice Perl 6 screencasts, but for Perl 5 I still think perldoc is the best thing you can find. Comprehensive and readable.
Also, Perl is a pretty big language, similar to natural languages in many cases: easy to get comfortable with simple things, and requiring more experience to get around the difficult/sophisticated syntax/concepts. Mastering Perl takes time, especially when you'll need to work with old Perl (it's pretty different to Modern Perl, written today).

This may not work for everyone,but personally, I find taking on small projects (or inventing my own) to be the only sufficient way of learning a language quickly.
One trick I use for high-speed, is to take stuff I've already written in other languages, and port it to the new one. I moved from Rexx to Perl this way a few years ago, then from Perl to Python recently, and now I'm moving from Python to Ruby in the same way. So, you could try taking something you've written in C, and porting it to Perl.
Frankly, being given a big pile of old code to comb through is a huge gift. You could try plugging the classes and functions into new short projects, to see how they behave. You could also try writing unit tests exercising them, to give you both familiarity with coding in Perl, and familiarity with the functionality of the codebase you're familiarizing yourself with.

One of the best ways of learning is:
Learn Perl debugger. If you are familiar with gdb, it should be a breeze
Run a few of those older scripts, and try to grok them, by looking up sercheable references on perldoc web site, tweaking/messing with them, and importantly, debugging them.
Whenever you run into some piece that you just don't get (especially feature/functionality that's not easily searcheable for like a keyword/built in function would be), come to SO with that specific thing and you'll get fairly reliably comprehensive answers.
Go through a decent set of books. O'Reilly are the best for Perl (Camel would be my recommendation) - they are actuially VERY quick/easy to skim through to get the main points of someone who already has C and Java experience. Couple that with the main perldoc tutorials (data structures, modules and OOP)
For doing new work of your own, get a hold of Perl Cookbook in addition to the above.

Related

Is emacs worth learning? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I currently program mainly in C/C++ and Java. I have done little bits of other languages here and there, but I am not proficient in them. I typically just use eclipse for java, and Microsoft Visual Studio for C/C++. I have read a lot of people swear by emacs, yet I haven't really ever used it. I tried it once, but it seemed way more complicated than the editors I was already using, and I gave up on it. However, I am wondering if maybe I should give it another chance, but I want to know if you think it is worth me putting the time in to learn how to use it? Are the benefits that great? And will it still most be useful in maybe 4 or 5 years? I read it has been around already for over 20 or so years.
Also, I am not really skilled at all in unix or Linux or any of that. Would you recommend I learn it? And if so, why?
Emacs is highly worth learning. While I don't like slideshare, let me link you to what Matz had to say about this topic.
I think that it is definitely worth to spend time to Emacs. That is, if you have the time. The first 2 months you do not feel really in control, though every little bit you learn feels like a victory. Now, after 6 months, I am amazed with the possibilities and wrote so many little tweaks. Before, I never did any programming and now I wrote a small little package for Emacs. Life is great.
EDIT in 2019: I do not recommdend it anymore. There's a steep learning curve, and with the great editors available these days it is not going to be worth your time investment. Especially since the amount of people who will be able to add new functionalities to Emacs will decrease (Emacs-Lisp is a shitty language)
Knowing either Vim or Emacs is definitely a good thing. Even when I'm doing C# development in VS, I always keep an Emacs window handy for quick text transformations, log viewing, IDL editing, Git merges, etc.
If your programming experience is only with the C family of languages, the exposure to Emacs Lisp will certainly do you some good!
It depends what your goal is. If your goal is to become a better programmer, then no - emacs won't help you. However if your goal is to be more comfortable working with files and doing development on unix systems particularly on the command line - then yes, emacs is a fine editor to learn. Likewise for vi or vim.
Emacs will surely be around for a long time to come, just like many other editors on the unix command line. It won't go stale, so don't worry about that.
I would definitely recommend you learn a command line editor of some variety, since being comfortable on the CLI (command line interface) is a very useful skill for real world developers. Whenever I interview a candidate for a developer position, CLI comfort is a must-have.

Why should I use Perl instead of Ruby/Python/etc? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
I love Ruby and have been using it for a few years to handle day-to-day scripting tasks. Lately however, I've had a number of people tell me that Perl is where it's at. I have nothing against Perl, but it seems like it's kind of fallen behind the times a bit.
However, that's probably just my perception, so I'm asking all of you, what makes Perl so great? I'm genuinely seeking information here; I'd like to understand why this language has such ardent followers.
I know a good handful of hackers who left Perl to go to Ruby. Python is obviously a nice language too. I am neither saying nor implying anything against either.
Pros for Perl 5
Since about 2005 or so Perl has been in a fairly dramatic renaissance in both CPAN and core releases. Perl 6 has helped drive this by sending concepts like role-oriented OO back. Strawberry Perl has made Perl hacking on Windows more like *nix.
The CPAN is huge, still growing, and most of the more widely used authors/teams are responsive to bugfixes. Most popular Perl modules are tested widely and well. CPAN testers recently sent their 10 millionth test report.
Many of the big kits have good communities associated where expert help is available quickly.
The tool chain has become very flexible.
The combination of perlbrew, local::lib, and cpanminus lets users (even without root) have an arbitrary number of perl versions and libraries accessible on the same box.
Many of things that Java, Ruby, Python do right come back to Perl and with facility. For example–
KinoSearch is Lucene but even faster by some benchmarks.
Catalyst is Rails but more flexible. It’s a completely agnostic C with regards to the M and V.
Plack is Python’s WSGI + Ruby’s Rack.
It’s as fast and personal or readable and robust as you want it to be.
A short one-liner can edit every HTML file in your tree when you’re in a hurry to fix something.
A clear and robust program with error reporting, logging, and feedback built on any of the 6 or 7 suitable HTML/XML packages could do the same for a client.
Perlmonks. Though there are notable exceptions, the Perl community is generally friendly, helpful, and positive.
There are quite a few good Perl jobs waiting to be filled. The back and forth between the high level languages has left oodles of Perl in the wild without a matching crop of Perl-centric devs. (I get 5-7 cold calls from recruiters a year.)
It’s fun. In quotes: “Perl has the happiest users.” I can’t speak to the scientific nature of that but I can say I only program today because Perl exists. Many other Perl hackers share this stupid giddiness for the language.
Keep in mind it’s not a zero sum game. The more languages you can wield, the better.
If I had to name one great strength of Perl, it's one word: CPAN.
Having worked with Ruby as well, I'd not say that Perl is necessarily better or worse, but definitely more mature. It is, after all, much older. However, it's not decrepit. It has plenty of modern stuff, e.g., Moose and the 5.10 and 5.12 updates have fixed a lot of problems that the ancient 5.0.x had.
(And if you're wondering: Perl 5 and Perl 6 are different languages. The similar name is an unfortunate mistake. Though Perl 5 does borrow ideas from Perl 6 and vice versa.)
CPAN.
The syntax of Perl is sometimes painful to look at but it is available on Unix machines everywhere and with the command line access to the huge number of packages in CPAN (which can also be accessed via browser), Perl is the de facto standard because of its broad applicability and availability.
These days, IMO the main reason to use Perl is that you can be pretty confident that just about any UNIX system will have it available, even on the sparser commercial UNIX distros.
Also, it has some features that make it work very conveniently with the UNIX shell and filesystem. Perl one-liners are convenient in shell scripting when you need a little more power.
If you're not on a UNIX machine then there's probably little advantage over more modern scripting languages.
First of all I love Python and Ruby as well. In fact I think anything you can do in anyone of the 3 languages you can do in the other just as easily.
CPAN however is a big advantage. There are not many times I find myself looking for a specific general functionality and not finding a module for it.
The greatest thing for me is however is that I can do absolutely everything I want, quickly, and in 10 different ways if I like, but maybe that's just because Perl is my 'mother tongue'.
Anyway, I think it depends on what you want to do. If you want to create a scalable website or web application with all the plumbing (authentication, authorization, session tracking, database ORM, etc, etc) taken care of, it can be done in Perl, but the hassle is not worth it. Go with Python (Django) or Ruby (Rails 3.0 rocks) then.
Good luck and watch out fire setting of flamewars with this subject, this kind of stuff get seriously get you hurt ;)
Rob

Are you taking up Perl and what got you into it? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I got into Perl years ago and always found it a fun and expressive language to work with.
I found that programming in Perl makes me quite productive thanks to its low overhead and the outstanding amount of ready-made solutions to common problems on CPAN.
If you're new to Perl, what got you into it?
I was coding PHP for a living, and then heard of their change from :: to \ as a name-space separator. I'm really not joking or being spiteful, but that is really what got the ball rolling.
Not to be elitist, but I suddenly realised that the people I had to collaborate with whom knew PHP understood very little in programming concepts in ways that frustrated me how they could be so blind, the people in the IRC rooms for it were no longer a source of help for my questions, and I usually spent more time answering questions and waiting for somebody to turn up whom could answer mine. Usually I ended up solving it myself.
Most the time I realised was people re-solving the same problems over and over again in increasingly bad ways.
I discovered problematic behaviours in PHP which defied logic and reasoning (like the array_merge_recursive family), and discovered functions that were undocumented in how to use them, and when I reported a bug in the functions, my bug was marked as "Bogus" and I was expected to be psychic.
I had a friend whom was constantly proclaiming the goodness of Perl, so I basically gave it a shot and now am hooked like an addict.
Additionally, my experience in other higher-order dynamically typed languages (JavaScript and Ruby, yes, JavaScript is a more powerful language than PHP in terms of language features) left me a knowledge with many ways to solve types of problems easily, but being restricted in such a way I had no way to use these powerful features. Perl satisfied this need.
Why Perl and not Ruby? I've played with Ruby a bit, but my experience taught me the support and documentation is sparse, the language is slow and immature. Nice it may be, but its still in diminished in capacity against Perl from what I've seen. And it shared PHPs major flaw that it has a huge user base comprised of total novices all doing things the wrong way, and I really wanted to not have to deal with that so much.
It's not nice to be elitist, but once you have tried to explain the same thing to 30 people (and taken an hour to get a simple concept into their heads every time) it reaches a point of frustration. (I can't cope with the 'There is somebody on the internet who is wrong' situation, If I can't SEE it, it doesn't happen)
I started doing Perl during my third year in computer science as a part of 'Scripting languages' course. I have a friend studying biotechnology and I helped her with some data mining scripts for dealing with protein databases (parsing text files, regexps, simple integrity checks). It was all very natural to do in Perl.
Then I got my first part-time job and had to use it professionally. I was responsible for developing set of batch scripts that handled some part of business logic in the company. And it was the task where Perl revealed all its potential. Need to get data from DB? - no problem, just go to CPAN. Need to automate wiki - no problem, go to CPAN. The amount of already created modules is overwhelming and you can be sure you will always find what you need in CPAN.
To sum up. For me, Perl is a swiss army knife of scripting languages. Everything can be done in it and it has huge number of additional modules even for very exotic tasks. And by the way, did I mention REGEXPS?
With Perl (and the expressive power behind TMTOWTDI), programming becomes a creative task. I can write if($expr) { $statement; } if I plan on having many else statements, or I can write $statement if $expr; if that makes more sense (for example, I'm fond of writing:
sub doSomething {
my($toObject, $argument) = #_;
die "No object specified" unless defined($toObject);
die "Object invalid: $toObject" unless $toObject->ISA('Example');
# Do stuff
}
but of course that's not always the easiest, and most expressive way of doing it; so I come up with a better way for the task at hand!). People complain because Perl lets you write horrible looking code; I love Perl because it lets me write code which looks pretty to me (and yes, I can see the downside of having a dozen different programmers writing in their own styles; I'll hold to the idea that good writers can be pretty expressive and understandable no matter how different the subject matter).
With other programming languages, I end up having to think my way through abstraction layers (how will this Map give me Collections whose Iterators I can use to ... and so on). With Perl, I'm usually only one abstraction level above basic Perl. For instance, DBI will give me database results as ordinary, everyday Perl scalars, lists and hashes, so everything I know about these simple, core data structures carries over to every task I put DBI to (Complicated data structures? That's what PostgreSQL is for!).
I've only been using Perl full-time for about a year, but these are the big wins for me, and the reason I first went full-time onto Perl after a year suffering at the hands of Java 1.4's Collections model (don't ask). Other programming languages make me feel like I'm putting together a jigsaw puzzle, as you line up all the modules and packages just right; Perl feels like a box full of Legos, with some "special" bricks (like DBI, CGI.pm and Test::*) thrown in for good measure. There are tons of different ways to solve any problem, and Perl lets you try any of them you like, in any way you like.
I'm still not that long time in the Perl community and what me first brought in was Larry Wall's humor and wisdom. True, Perl has it quirks but the language comes from an understanding of things that is very close to mine so I'm much less comfortable with Python and to a lesser degree Ruby.
I don't do web app's more GUI with WxPerl and it works just fine. I'm very interested in languages also in lesser known like factor, boo, rebol and so on but all in all is Perl my choice. and it's because a mixture of powerful syntax (can be very functional if you like it), the community, CPAN of course, and, like I said before, due to the cosy feeling being in the right place.
Perl is its community, which is the reason to use it both on a social and practical level. (See CPAN and Perlmonks, which likely inspired SO.)
There's a lot of freedom when coding in Perl; you can write some wicked-crazy unreadable hacks, but it doesn't take long once you've gotten a feel for the language (and learned how to use perltidy :-) ) before you realize that well-written perl code can look downright pretty.
It's interesting; I ended up as a full-time Perl programmer after learning it for my sysadmin-type job in college; and now it's my strongest skill. I'm going to stick with Perl for a while because so far the language has been versatile to grow with me. I write a lot of systems software in Perl, and decided to pick up web programming for fun, and Catalyst was there waiting for me. Do I want to try out a new language paradigm? Perl will probably support it. In contrast, when I was coding in PHP for a time, I immediately felt like I was pressing against a glass ceiling.
I work as a technological troubleshooter for a big organization in southern OH. I had to learn Perl to keep some automated network text manipulation systems up and running and eventually got a little excited about it. I eventually thought of myself as a developer and wrote some programs that parsed some database data and made some people’s lives a little easier. But after reading some of the posts on this website and listening to the stackoverflow podcast and even starting to read the book Code Complete from someone’s suggested reading list I no longer have any delusions that I was a developer of Perl or any other language for that matter. However, maybe someday I could be.
I had used awk a few time for shell scripts way, way back in the days. In one ancient project we needed to implement the a TELNET protocol connection, so I wrote a quick version in Perl 4. It worked really well, and I started to really like the language.
Later, I wrote a big full commercial web application in Perl 5, complete with it's own framework and database. I was careful not to use to many of Perl's more esoteric features, so the code looked more like C than Perl. It worked really well, performance was good and the code was easily extended.
Recently I've been working in Java, but I often find myself missing the Perl's loose typing, and its ability to encapsulate things way better than Java. My favorite features were being able to put Perl datastructures (arrays and hashes) and code directly in config files and execute them, and the ability to tie code to syntax like arrays. Both lead to some really slick code.
Paul.
simple syntax, powerful scripting capabilities for win32 and unix systems, and totally powerful regex!
I pickup Perl on my first job where I had to write plenty of automation script for electrical engineers to mine datalogs and format them to Excel and sometimes deal with sql server too. With Perl I could usually get something working rather quickly, so all is good in the manufacturing land. :P
I started using Perl as an enhancement to our build process for embedded development. We needed to develop diverse outputs based on our cross compiled payload and Perl was a great fit.
Our enhancements included floating-point to hexadecimal conversion, S-record post-processing, and checksum modifications.
Not that this kind of work can't be done with many other tools, but I would definitely recommend Perl for build-related work.
What brought me to Perl was when I saw the DBI and realized that I could write the ESQL/C programs I was writing at the time in one fifth the time.
What has kept me using Perl is that the two other languages likely to unseat it are both strongly typed. That is
print "10" + 5;
is a type error rather than 15.
I'm not taking it up. I had to work on a project in Perl a few years ago, and I came to really dislike the language. It has a sometimes-awkward syntax and a lot of crazy gotchas that I found hard to work with. Honestly, I think Ruby has superseded Perl in many respects: it's good at roughly the same things, but has much nicer features and is easier to use.
Perl still has CPAN, though, which even Ruby can't match (although Ruby has a lot of useful libraries, too).
I considered learning Perl last year.
It was the only technologies that I actively decided not to learn. This is nothing directly against the language itself, it just seemed that I would be coming to the party 10 years too late. It is very useful for the shell scripting tasks that it was designed for but for me personally I prefer languages with a stronger coherence.
Perl 6 seems like it's on indefinite hiatus and even when it arrives I don't believe that it will make the language profoundly more compelling.
Also, Larry Wall scares me.
For my situation Perl wasn't the right choice and thats why.
Perl is not as bad as I thought. I used to use it in a couple customer scripts about one year ago, and even grew to like it a bit. Then again, I've never ever missed it since.
The reason? It's mostly a write-only language. Going above a 100 line solution made me be wary of my own code, which is definately not a good outcome. With other languages that bar is considerably higher (maybe 1000 or 10000 lines).
I see no reason to go for Perl in new projects, for new users, in -soon- 2009.

How can I learn to write well-structured programs in Perl? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I've started learning Perl but most of my former programming experience has been in languages that emphasize object oriented programming such as C# and Java. All the Perl examples I have found tend to be long single function programs and I find my self writing code the same way. Are there any resources or tutorials for writing maintainable well structured programs?
Firstly, regardless of what sort of Perl programming you're doing, you'll probably find Perl::Critic to be invaluable. The command-line tool is by far the most convenient for getting feedback on your code, but you there is also a web interface where you can upload your Perl code and receive instant, automated feedback. Note that Perl::Critic isn't going to teach you good structure, but it will help improve your style in general, and steer you away from some common mistakes.
To go with Perl::Critic, I'd recommend getting a copy of Perl Best Practices (PBP). It contains a lot of detailed information upon which Perl::Critic was based. Even if you disagree with particular guidelines in the book, it makes you think about how you code, and that's very, very valuable. You don't have to shell out money for a book, but the two compliment each other very nicely, and there are lengthy discussions you'll find in PBP that you won't get from Perl::Critic.
If you've already worked with other OO languages and OO design, the you'll probably find Moose to be a comfortable transition. Moose is very stable, very well supported, and has a huge and active community (especially via IRC). Moose supersedes almost all the existing OO Perl advice out there, including my own. Object Oriented design is common for a reason; it makes sense for a lot of projects, and there's no reason not to use it in Perl.
Personally, I found a massive improvement in my own program structure when I moved to a test-driven development model. Under such a model, breaking a problem down into small, easily tested units is essential. Start with Test::Tutorial if you're new to testing in Perl and then look at some other testing resources or books if you want to learn more. Use a tool like Devel::Cover or Devel::NYTProf to see what your test cases are hitting and what they're not. Having code that's hard to test is often a sign of poor structure.
Having said all this, the best teacher by far is to get involved with an existing Perl project with experienced contributors. See how they do things, and when you make contributions, think about their advice. If you want a real application with awesome cool value that seems to have sucked up the very best and brightest of the Perl community, then I'd recommend getting involved with Padre, the Perl editor.
If (for whatever reason) you can't get involved with another project, then consider posting code samples to communities such as Stack Overflow, or PerlMonks. Better still, if you can make your code open source, then do so, and solicit feedback. All programming languages are better learnt with others who are already familiar with them, and Perl is no exception here.
May you do Good Magic with Perl,
Paul
Perl Best Practices
If you're learning OO Perl you might as well move on to the next big thing and start learning Moose.
Moose is a postmodern object system for Perl 5 that takes the tedium out of writing object-oriented Perl. It borrows all the best features from Perl 6, CLOS (Lisp), Smalltalk, Java, BETA, OCaml, Ruby and more, while still keeping true to its Perl 5 roots.
Moose is 100% production ready and in heavy use in a number of systems and growing every day.
If you already know how to write well-structured programs and you want to write well-structured Perl, but the only impediment to that is the abundance of ancient, crufty, spaghetti-code examples that are scattered around the net and refuse to die...
Ignore the examples. Or at least ignore their poor structure and only pay attention to the small syntactic bits that you need to learn from.
There is nothing in Perl that pushes you to write bad code. If you already know how to write good code in other languages, then you can apply the exact same principles and practices in Perl. It's merely a matter of discipline, just like in any other language.
If you feel you already are learning the basics and want to improve program structure, then I'd suggest these books, probably best to read in this order:
Intermediate Perl -- this is probably the place to start for what you're asking about; covers developing and using Perl modules (essential for good structure), references, complex data structures, OO, and more
Perl Medic: Transforming Legacy Code -- demonstrates well-structured Perl by showing how to fix poorly-structured Perl
Effective Perl Programming: Writing Better Programs with Perl -- a classic, but still useful; full of Perl idioms that will help you write more Perl-ish Perl; not much on OO, but covers more fundamental coding structures to make your code more succinct and yet more expressive. I think of this as the book that got me from Perl literacy to Perl fluency
All three are best once you've comfortable with basic Perl syntax, but none of them get too far into esoteric advanced concepts that you can't follow if you're still starting out in Perl but have reasonable programming experience in other languages already.
Apart from the sources mentioned above I strongly recommend the book
"Higher-Order Perl" by Mark Jason Dominus.
If you can afford it buy it, otherwise the author has put the book on his website for free as in free beer, Free Higher Order Perl. For the PDF version: direct download URL (1.9 MB).
Edit:
I forgot to mention Perl Design Patterns. The PerlDesignPatterns site is a very good resource or reference for learning Perl design patterns.
Object-Oriented Perl
http://perl.about.com/od/objectorientedperl/Object_Oriented_Perl.htm
http://www.codeproject.com/KB/perl/camel_poop.aspx
http://www.tutorialspoint.com/perl/perl_oo_perl.htm
Personally, I didn't write good OO Perl until I started learning Java. I recommend you spend a small amount of time learning OO in a true OO language and apply what you learn to Perl.
For a place to be mentored, PerlMonks is GREAT.
Write Perl the way you would write C, although you should take advantage of some things BEGIN blocks and modules. It should be formatted so that it looks more or less like old style K&R C code.
As for structure, skip the OO stuff and style it as ADTs instead:
http://en.wikipedia.org/wiki/Abstract_data_type
Basically you do this by using data-structures where you would have used objects in OO (and separating out the algorithms into their own functions).
Then, pick only one way to do things and stick to it, consistency is vital to readability.
If you manage that, the code can be both readable and easy to understand.
Paul.

What's the best online source to learn Perl? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I am new to any scripting language. But, still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, what is the best online resource to learn Perl?
If you already know a bit of perl, PerlMonks is a great online resource. You can ask questions in their Seekers of Perl Wisdom section and the answers are often of very high quality. Many people who keep up with the latest developments in Perl hang out there.
As an added bonus, if you ask a clear question, many times the people there take the time to look at the underlying problem and will point out alternate approaches rather than simply taking your question at face value.
I realize that the question is about online sources, but I taught myself Perl in about three weeks thanks to the following books:
Learning Perl
Intermediate Perl
I already had a little bit of background knowledge in C, but the way these books teach is phenomenal. Scripts I've written in Perl are currently powering the data analysis process used by some instrument teams on the UA/NASA Phoenix Mars Lander - and I'm a junior in college! If it's good enough for NASA, it's good enough for you :)
The perldoc documentation is the best source for understanding how to use the language well.
The camel book "Programming Perl" is an excellent printed reference with thorough explanations written by the same people who wrote the perldocs (other books with animals on them are mostly ok.) Beware online tutorials - many of them teach very sloppy perl.
Use 'warnings' and 'strict' - then perl will be very helpful in pointing out your errors.
Perlmonks is also great (they will also tell you to use 'warnings' and 'strict'.)
And then you have to learn the CPAN one module at a time (which is where perlmonks and mailing lists are very helpful.)
http://learn.perl.org/
From the Online Library:
Beginning Perl
Impatient Perl
I highly recommend starting with Simon Cozens' Beginning Perl book.
And also, reading the Perl documentation.
Perl is in a state of (comparatively) rapid change, and has gotten into the position where the best documentation beyond a basic introduction to Perl 5 -- the current major version -- is the electronic documentation which comes with the language itself.
Read 'perldoc perlintro', then look to 'perldoc perl' for the rest of the core language documentation. Note that on Debian systems, you'll need to 'apt-get install perl-doc' to get this documentation.
Once you've got a handle on things, check out 'perldoc perldelta' to see what's new in the version of Perl installed on your system (which should be 5.8.8 or 5.10 these days -- much cool stuff in 5.10!). If the perldelta page isn't making any sense (and believe me, I remember how that feels), just come back to it later.
Finally, freenode #perl for questions you can't find answers to in the docs.
The Official Perl 5 Wiki is a great resource with lots of info and links, and it aims to be beginner-friendly.
Also see the bottom of the wiki home page for the latest headlines from the Planet Perl feed aggregator. It's useful to skim over every few days, because it sometimes answers questions that you didn't know enough to ask, but which you should be asking.
I would very much recommend Programming Perl, but beware you may need a subscription to Safari in order to read it online.
As other people noted, the online book Beginning Perl has a good reputation and is written by a very clueful expert and active Perl contributor. Other than that, I concentrated resources for beginners in the Perl Beginners' Site, and you can probably find something there that would be to your liking.
If you are a beginner, I would suggest you take a look at the cookbook provided by PLEAC. You can find it at http://pleac.sf.net. There you can find cookbooks for most languages.
A new resource is chromatic's Modern Perl, which is available for free online, though you may purchase a paper copy if you prefer.