[Ilugc] [TIP] perl tutorial X (some code tidbits)
Hope you are familiar with the programming language by now. If some of you still dunno how to execute a simple perl script, please remember this. $ perl foo.pl $ cat foo.pl for(1..1000) { print; print \n; } You can easily accomplish many difficult tasks in text processing with perl even without using any regular expressions. You can easily convert all input into upper case: $ $ cat i.pl while() { print uc; } Perl's documentation is written in plain old documentation format (POD) which can be converted into pdf, text and of course the nroff man format. You can find all these converters: $ pod2 pod2html pod2latex pod2manpod2test pod2text pod2usage Perl's POD documentation can either be invoked using: $perldoc foo.pl if the file contains the documentation inline or even if the file that contains pod is in the standard search location. $perldoc perltoc will tell you all the topics covered by perl's installed documentation. It is huge, massive and no amount of reading will help you learn perl unless you really get down to trying perl and running it. Perl cannot be run interactively like Python. You have to run it one script at a time. All perl functions are written in the perlfunc man page. $perldoc perlfunc But it is useless. Instead you say $perldoc -f split or $ perldoc -f join or some such thing. Some of the perl functions you can learn today are 1)map 2) tr 3) substr 4) push 5) shift 6) pop 7) keys 8) values 9) pack 10) ord Just google and try out the examples. -Girish -- G3 Tech Networking appliance company web: http://g3tech.in mail: gir...@g3tech.in ___ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
Re: [Ilugc] [TIP] perl tutorial X (some code tidbits)
On Mon, Dec 12, 2011 at 8:21 AM, Girish Venkatachalam girishvenkatacha...@gmail.com wrote: Perl cannot be run interactively like Python. You have to run it one script at a time. The Perl interpreter's inbuilt debugger comes close to it. You can add the '-d' switch like 'perl -d myscript.pl' or simply 'perl -d'. There is an external tool called 'psh', which is a shell replacement that uses perl. YMMV. cheers, -Suraj -- Career Gear - Industry Driven Talent Factory http://careergear.in/ ___ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc