Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: A simple backticks question

by BrowserUk (Pope)
on Mar 17, 2014 at 16:27 UTC ( #1078620=note: print w/ replies, xml ) Need Help??


in reply to A simple backticks question

The for loop iterates a (potentially huge) list returned by the backticks.

If you want to avoid creating that list, you can use open thusly:

open CMD, '-|', 'ls -l' or die $!; while( my $fname = <CMD> ) { chomp $fname; #process the file names one at a time } close CMD;

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: A simple backticks question
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2015-07-28 10:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls