Perl: the Markov chain saw | |
PerlMonks |
Re: need help on declaring variablesby hipowls (Curate) |
on Mar 03, 2008 at 09:35 UTC ( [id://671617]=note: print w/replies, xml ) | Need Help?? |
When using regular expressions it is usually a good idea to put them in a condition. The greater danger of your code, apart from using uninitialized $1 and $2, is using an initialized $1 and $2 from a previous match. The capture buffer variables $1 etc are not reset to undef when a match fails so you may produce erroneous output without any outward sign.
In Section
Seekers of Perl Wisdom
|
|