in reply to Interpolating variables in a string

What about
my $newstr = eval "qq{$str}";
this works, even if $str contain a ".
Boris

Replies are listed 'Best First'.
Re^2: Interpolating variables in a string
by dpuu (Chaplain) on Oct 13, 2004 at 22:34 UTC
    Though not if it contains an unpaired '}'.
    --Dave
      then do it like the first poster suggest:
      ( my $newstr = $str ) =~ s/(\$\w+)/$1/eeg;
      Boris