in reply to
Variable in regexp
Another way is to use whitespace in the regex with the
//x
modifier (
perlre
)
/ $var _ /x
[download]
Comment on
Re: Variable in regexp
Select
or
Download
Code
Replies are listed 'Best First'.
Re^2: Variable in regexp
by
JavaFan
(Canon)
on Mar 22, 2011 at 01:33 UTC
The disadvantage is that that only works in patterns. The
${var}_
method also works in double quoted strings.
[reply]
[d/l]
In Section
Seekers of Perl Wisdom