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;
|
|---|