Is there anyway to use a use constant MYCHAR => 'X'; defined constant within a regex?Since it's just an interpolated string there's no 'simple' way of doing it ,but ...
use constant FOO => "abc"; my $str = "abcdefg"; $str =~ s<${\FOO}>(\U$&); print $str,$/; __output__ ABCdefg
_________
broquaint
In reply to Re: Constants in regexes.
by broquaint
in thread Constants in regexes.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |