Perl always allows curlies to surround the symbol's name (or expression) following sigils!
So
$txt =~ s/test/${foo}bar/;
instead of
$txt =~ s/test/$foobar/;
HTH =)
Cheers Rolf
( addicted to the Perl Programming Language)
Documentation wasn't easy to find:
from perldata#Scalar value constructors
As in some shells, you can enclose the variable name in braces to disambiguate it from following alphanumerics (and underscores). You must also do this when interpolating a variable into a string to separate the variable name from a following double-colon or an apostrophe, since these would be otherwise treated as a package separator:
In reply to Re: Stupid question about regex with string followed variable in replacement ( ${varname} )
by LanX
in thread Stupid question about regex with string followed variable in replacement
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |