Want to know more?

Linux Format - - TUTORIAL -

First and fore­most, Perl comes with its own doc­u­men­ta­tion sys­tem called perl­doc. In case your Linux dis­tri­bu­tion com­plains about the perl­doc com­mand be­ing miss­ing, make sure you have a rel­e­vant pack­age in­stalled, as it may not come as a de­fault.

Perl­doc spans three ar­eas: lan­guage man­ual, lan­guage ref­er­ence and mod­ules doc­u­men­ta­tion. Each of these is or­gan­ised into sec­tions typ­i­cally called perl<some­thing>, and you sim­ply run perl­doc perl­foo to get the topic you are af­ter. There are quite a few sec­tions re­ally, but we find our­selves open­ing ones more of­ten than the oth­ers:

perl­func – Perl func­tions. This in­cludes a cat­e­gorised list of what Perl can do out of the box. Handy if you’ve for­got­ten the syn­tax or are look­ing for the way to ac­com­plish a sim­ple task such as delet­ing a key from the hash.

perlre – Perl reg­u­lar ex­pres­sion di­alect. This cov­ers the ba­sics, while perl­re­back­slash and perl­rechar­class take on es­cape se­quences and char­ac­ter classes, re­spec­tively.

perl­ref – Perl ref­er­ences. Not re­ally nec­es­sary for one-lin­ers but a must for se­ri­ous Perl pro­gram­ming. Also a ba­sis for Perl ob­jects. The perl­doc com­mand is not a mere browser. perl­doc -f looks up a func­tion by name, and perl­doc -v does the same for vari­ables. For bet­ter UX, see the web ver­sion hosted at http://perl­doc.perl.org.

As for books, be sure to look at Pro­gram­mingPerl by O’Reilly. Dubbed the ‘Camel book’, co-au­thored by Larry Wall, and be­ing 1,000+ pages long, it’s what they call “a canon­i­cal Perl ref­er­ence”.

Newspapers in English

Newspapers from Australia

© PressReader. All rights reserved.