Librenix  
(Show all Perl articles . . .
)  
Headlines | Linux | Apps | Coding | BSD | Admin | News
Information for Linux System Administration 

Perl tips

Up
vote
Down

Ten perl one-liner tips and tricks...
The core of any perl one-liner is the -e switch, which lets you pass a snippet of code on the command-line:

perl -e 'print "hi\n"' prints "hi" to the console.

The second standard trick to perl one-liners are the -n and -p flags. Both of these make perl put an implicit loop around your program, running it once for each line of input, with the line in the $_ variable. -p also adds an implicit print at the end of each iteration.
 read more | mail this link | score:8585 | -Ray, June 1, 2010
More Programming articles...

Buy Digital Art on Acrylic

coding headlines

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

 
Articles are owned by their authors.   © 2000-2012 Ray Yeargin