in reply to RE: Map: The Basics
in thread Map: The Basics
This way of doing things is deliberate, as it eliminates unnecessary assignments when you want the results to go back to the same array.my @array = <FILE>; map s/\#.*$//, @array;
Except that he explicitly said that if you aren't using the list returned, you shouldn't use map, you should look into another looping structure, such as:
To do otherwise obfuscates the purpose of your loop.my @array = <FILE>; s/\#.*$// foreach @array;
In Section
Tutorials