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
In reply to Re: ls piped tpo perl -pe runs indefintely
by Anonymous Monk
in thread ls piped tpo perl -pe runs indefintely
by ISAI student
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |