in reply to Re: Re: Re: constants within regular expression?
in thread constants within regular expression?
@{[MYTEST]} leaves out the all-important "quotemeta".
Well, to be fair, whether or not it is all important depends entirely on the behavior you want. Granted, the OP, probably did not want the dot in ".txt" to match anything; so he'd probably want to do it like /\Q@{[EXTENSION]}/ instead. But, someone else might want to use a constant like use constant FILEPATTERN => 'foo.*\.txt'; in which case he probably wouldn't want to quote his metacharacters.
-sauoq "My two cents aren't worth a dime.";
|
|---|