[Buffalo-pm] one liner

Kevin Eye eye at buffalo.edu
Fri Jun 20 13:51:42 CDT 2003


FYI, the contents of @INC are also printed when you run "perl -V".

Also, along the same lines as a one-liner a week, is anyone/everyone 
here subscribed to Mark Jason Dominus's perl QOTW (quiz of the week) 
mailing list? Each week there are two problems to be solved with perl 
(an easy one, and an expert one), some lively discussion, and a very 
thorough recap of what worked and what didn't.

For info, have a peek here:
http://perl.plover.com/qotw/

Also,

  - Kevin

On Wednesday, June 18, 2003, at 03:06  PM, Jason Parker-Burlingham 
wrote:

> "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
> _______________________________________________
> Buffalo-pm mailing list
> Buffalo-pm at mail.pm.org
> http://mail.pm.org/mailman/listinfo/buffalo-pm
>


--
Kevin Eye
Web Applications Developer
Creative Services and Marketing
University at Buffalo
330 Crofts Hall
Buffalo, NY 14260
eye at buffalo.edu
phone (716) 645-5000 x1435
fax (716) 645-3765




More information about the Buffalo-pm mailing list