in reply to ls piped tpo perl -pe runs indefintely
The second one intends to do the same, that is, execute the body for each of the lines of the files listed by ls, but here you are actually modifying @ARGV, which causes the implicit <ARGV> to terminate after the first iteration.
My guess is that if you remove the -n, both will do what you want them to do.
|
|---|