[Buffalo-pm] one liner
Jason Parker-Burlingham
jasonp at panix.com
Wed Jun 18 14:06:14 CDT 2003
"Kevin Christopher" <bpm at binarymojo.net> writes:
> 1-liner #48 at http://www.samag.com/documents/s=1334/samtpjoneliners/
> has:
> perl -e 'print "$_\n" for @INC'
>
> an alternative for your 1-liner
> perl -e 'print join("\n", @INC), "\n";'
If I ever find myself typing something like
print "$_\n"
on the command line I tend to replace it with the equivalent -l idiom:
$ perl -le'print for @INC'
Although not useful in this case, it's useful in other scripts because
of the auto-chomping behavior it gives to filehandle reads. See
man perlrun for more information.
--
Stay up-to-date on what I'm doing lately:
http://www.panix.com/~jasonp
More information about the Buffalo-pm
mailing list