![]() |
|
P is for Practical | |
PerlMonks |
Re: String Match Use of $1 Uninitializedby kennethk (Abbot) |
on Dec 16, 2009 at 19:36 UTC ( [id://813058]=note: print w/replies, xml ) | Need Help?? |
The issue is that you are not capturing any text from your regular expression in the second case, so that sets all the captured groups to undef. Which strings are captured is controlled by parentheses in your regular expression - see perlre, perlretut. For example, of you wanted to capture the letters 'AIR' from your string into the $1 buffer, you might use:
In Section
Seekers of Perl Wisdom
|
|