in reply to can i get a matched values as an array
BTW, your:
is matching something and then replacing it by itself. Not only does this seem a little pointless (why not just m/age ([0-9]+) name ([a-z]+)/ ?), but the documentation warns that:$str =~ s/age ([0-9]+) name ([a-z]+)/$&/ ;
The use of this variable anywhere in a program imposes a considerable performance penalty on all regular expression matches.so using $& when you don't absolutely need it looks like a mistake...
|
---|