in reply to ls piped tpo perl -pe runs indefintely
shift keeps on reducing the number of elements in @ARGV in the second instance. Thus the while loop (via -n option) ends eventually. See perldoc perlrun, and Deparse ...
perl -MO=Deparse -ne ' map { print $_ , "\n" if ( -d $_ ) ; } @ARGV +' LINE: while (defined($_ = <ARGV>)) { map {print $_, "\n" if -d $_;} @ARGV; } -e syntax OK
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ls piped tpo perl -pe runs indefintely
by Anonymous Monk on May 01, 2012 at 13:59 UTC |