in reply to Interpolating variables in a string

It's a FAQ.
  • Comment on Re: Interpolating variables in a string

Replies are listed 'Best First'.
Re^2: Interpolating variables in a string
by saintmike (Vicar) on Oct 13, 2004 at 22:48 UTC
    Actually, I was looking for a complete solution to tap into Perl's double quote interpolation mechanism. The solution proposed in the FAQ won't work in these cases:
    'abc @var def' 'abc ${var} def' 'abc $$var def'
      In that case, an eval like you used above is the only way. You can use quotemeta to escape the quotes.
        Of course, quotemeta would escape everything, including the subexpressions he wanted to interpolate...

        --
        [ e d @ h a l l e y . c c ]