|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Passing regex to a subroutineby kcott (Parson) |
| on Oct 13, 2012 at 10:43 UTC ( #998838=note: print w/ replies, xml ) | Need Help?? |
|
G'day ll001, I see that ++aitap has identified your problem. Seeing your usage of $regexStr, I was wondering if you were aware that qr{...} does not return a string per se. It actually returns a Regexp object. When stringified, this is overloaded to produce something you may not have expected.
See perlop - Regexp Quote-Like Operators for details. -- Ken
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||