|
|
| Just another Perl shrine | |
| PerlMonks |
Re: Common Regex Gotchasby rovf (Priest) |
| on Jul 07, 2008 at 08:59 UTC ( #695930=note: print w/ replies, xml ) | Need Help?? |
|
Maybe it's worth to include the following, which has bitten me once too: One common use is to get regexp from an external source - for instance, your commandline - into your program, so you end up having somewhere something like: The trap here is when $pattern happens to be the null string, yielding the Regexp //. This special regexp, unless it is used as argument to the split function, means: "Match again the most recently encountered regexps", which can lead to pretty bizarre program behaviour.
-- Ronald Fischer <ynnor@mm.st>
In Section
Tutorials
|
|
||||||||||||||||||||