Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: add/replace map result into existing hashby DrHyde (Prior) |
on Feb 19, 2014 at 11:41 UTC ( [id://1075442]=note: print w/replies, xml ) | Need Help?? |
Your for loop is effectively a map:
Does that help? BTW, the `shell stuff` will give you a scalar with embedded newlines, not a list of lines of text which is what I presume you want. You'll be better of using open(my $fh, '-|', "zcat $_") instead and read a line at a time, and translate the little sed snippet into perl. Finally, why do you think that rewriting the code will save memory or make it faster? And do you know that it actually needs to be made faster? Have you profiled your code?
In Section
Seekers of Perl Wisdom
|
|