in reply to calling regular expressions returned by functions?
Its not pretty, but this works:
use constant DOT => qr[\.];; print grep $_ =~ DOT, qw[ a b c . d e f];; .
Though it is really hard to see the benefit of making constants of those particular regex.
It's not like they are going to change anytime soon, and if they did, then you'd want to change their names also, which means you'd have to edit the place of use as well anyway.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: calling regular expressions returned by functions?
by Anonymous Monk on Mar 29, 2012 at 18:55 UTC |