in reply to can i get a matched values as an array

BTW, your:

$str =~ s/age ([0-9]+) name ([a-z]+)/$&/ ;
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:
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...