in reply to Map not giving me what I thought it would.
map { s/^-// } @ARGV; print join ("\n", @ARGV) . "\n";
to this
print join "\n", map { s/^-// } @ARGV;
however, the second time, you received a number indicating the number of succesful matches. Check out the /gmodifier you want - to match more than once in the string.
Here is a simpler example that shows what was happening each time you applied your regexp to $_
$_ = 'aaaaaaaaaaa'; my $x = s/a//; print "$x\n";
|
|---|