I often use it for one-liners. See perlrun for an example involving (GNU) find. The other example is somewhat broken, unfortunately.
Another example: print second column of file if first starts with an `X'...
cgn_perl -lane 'print $F[1] if $F[0] =~ /^X/'
Well, typing an extra \n isn't that bad, but...
In reply to Re: How do I use the switch -l?
by ariels
in thread How do I use the switch -l?
by iic
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |