It seems that many react and cringe when they hear the word Perl. It's a funny reaction to me. Because, all of the documentation for Perl is superb. Writers like +Randal L. Schwartz or +Gabor Szabo will guide you with great thoughtful tutorials in their respective books and on-line websites.
My reaction to comments to the negative is that most are ill-informed and if a prospective student were to spend just two hours reading +Randal L. Schwartz's Learning Perl, they will have built a solid foundation upon which to expand their technical skill set.
Perl is found resident on most Unix, BSD, and Linux systems by default. It often plays a large part in many 'behind the scenes' activities running on your system. If you invest the time to learn, I would say it would not be a wasted effort as once done, Perl will be their in your toolbox for you to grasp and use on so many occasions throughout life.
Will Perl eventually die? Some say it will. But if you go by a recent study from RedMonks that measures the spectrum of programming languages in use on GitHub, it is evident that Perl is quite alive and well.
![]() The RedMonk Programming Language Rankings: January 2013 |
Put forth the initial effort to learn Perl. While the initial hill climb is steep, once mastered, Perl is powerful in the hands of the learned. Perl can and does do the 'heavy lifting' in so many ways as exemplified by the CPAN repository. CPAN is one step away for anyone with Perl with a diverse set of open source modules ready to fill gaps in your programming needs.
Perl isn't just for writing projects; it is also good for quick 'one-off' utilitarian functions and can be quite convenient when invoked right from the Bash command line. This one-liner upper-cases an entire text file:
$ cat sample.txt Practical Extraction Report Language $ perl -pi -e “tr/[a-z]/[A-Z]/” sample.txt $ cat sample.txt PRACTICAL EXTRACTION REPORT LANGUAGE
Often, I visit +Gabor Szabo's excellent Perl5 Maven website to see what he is up to and come away learning something I didn't know before. At his site you'll find his most excellent new book Perl Maven for Beginners, including in eBook downloadable format. You can also find regular posts of his ideas and a dedicated section to tutorials especially made to coddle and encourage the newcomer to venture into this feature-rich, powerful programming language. Here's a tutorial on reading a comma separated value (CSV) file and the requisite code:
#!/usr/bin/perl use strict; use warnings; use Text::CSV; my $file = $ARGV[0] or die "Need to get CSV file on the command line\n"; my $csv = Text::CSV->new ({ binary => 1, auto_diag => 1, sep_char => ',' # not really needed as this is the default }); my $sum = 0; open(my $data, '<:encoding data-blogger-escaped-die="" data-blogger-escaped-fields="$csv-" data-blogger-escaped-file="" data-blogger-escaped-my="" data-blogger-escaped-n="" data-blogger-escaped-not="" data-blogger-escaped-open="" data-blogger-escaped-or="" data-blogger-escaped-ould="" data-blogger-escaped-utf8="" data-blogger-escaped-while="">getline( $data )) { $sum += $fields->[2]; } if (not $csv->eof) { $csv->error_diag(); } close $data; print "$sum\n";
I can assure you from experience that for every 1 line of Perl, writing an equivalent piece of code in C will yield a ratio of 10 or more lines to accomplish same. This is not to suggest that Perl serves to replace the venerable C language--certainly not. But there are many applications where Perl excels and is the right tool for the job, particularly systems integration and the Internet web development.
So, please. Make the investment. Randal and Gabor will be there to help you. I promise. Learn Perl and it will be with you to serve your needs always.
-- Dietrich