Don't ask to ask, just ask | |
PerlMonks |
Re: storing string matched by regular expressionby jsegal (Friar) |
on Jun 27, 2002 at 14:36 UTC ( [id://177718]=note: print w/replies, xml ) | Need Help?? |
You need to have the expression evaluated in "list context" to get it to return what you are interested in, and you need capturing parentheses inside the pattern to show what you want to collect (in this case, I think it is your entire pattern).
i.e. (Note the parentheses around $thisresult and in the pattern). If the match fails, $thisresult would be set to undef. See "perldoc perlop" the (section on "m") and "perldoc perlre" for more details --JAS
In Section
Seekers of Perl Wisdom
|
|