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:8100 | -Ray, June 1, 2010
More Programming articles...

Decorate your home or office with Fine Art

coding headlines

OpenShift Online: a non-developer guide

Tutorial: Install SVN, Configure multi-protocol access (Ubuntu 11.10)

bash scripting: Looping through a list

perl1line.txt: A handy Perl script collection

I wrote my first programming e-book: Awk One-Liners Explained

Python for Kids

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

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