Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: ls piped tpo perl -pe runs indefintely

by JavaFan (Canon)
on May 01, 2012 at 13:45 UTC ( [id://968252]=note: print w/replies, xml ) Need Help??


in reply to ls piped tpo perl -pe runs indefintely

The second one modifies @ARGV, the first one doesn't. Due to you use of -n (why?), the first one executes the body for every line of the files listed by ls. It should actually terminate, but if you have a lot of large files, this my take a while.

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://968252]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-04-23 11:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found