Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Map not giving me what I thought it would.by princepawn (Parson) |
on Jun 02, 2001 at 08:55 UTC ( [id://85160]=note: print w/replies, xml ) | Need Help?? |
First,shorten this:
to this
now for an answerIn the first case, you were modifying $_ and as a result modifying@ARGV in place. Since you printed @ARGV, you got what you expected.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 $_
In Section
Seekers of Perl Wisdom
|
|