in reply to printing @INC contents and Command line interpretation

You got some possibilities from the CB (from shmem, graq and me)

$ perl -le 'print for @INC' $ perl -e 'print "$_\n" for @INC' $ perl -e 'print join"\n",@INC' $ perl -e'$"="\n"; print"@INC\n"'

All of them prints the contents of @INC from the command line

citromatik

Replies are listed 'Best First'.
Re^2: printing @INC contents and Command line interpretation
by papidave (Pilgrim) on Aug 07, 2007 at 14:15 UTC
    I tend to favor the join myself for one-liners like that, but I always include an empty item after @INC so the last line will get a newline on it.
    perl -e 'print join "\n", @INC, ""'
    The variant that uses "for @INC" avoids that question; perhaps I may need to make a style change. I wonder how they compare for performance, when run in a tight loop?
    push @things_to_do, performance_test( $foreach, $join );