in reply to Re: Scalar joining, concatenation, involving varying text
in thread Scalar joining, concatenation, involving varying text

Thanks for the reply. Could you elaborate on the logic here. Does \ prevent interpolation until later evaluation? I just want to make sure I understand, \$$_allow us to substitute a variable name as the name for an implied variable within a loop.

Replies are listed 'Best First'.
Re^3: Scalar joining, concatenation, involving varying text
by ikegami (Patriarch) on Jun 27, 2005 at 20:32 UTC
    \ in string literals causes the next character as ordinary, so yes, it will will prevent interpolation:
    $cow = 'moo!'; $_ = 'cow'; print("$cow"); # Prints moo! print("\$cow"); # Prints $cow print("\\\$cow"); # Prints \$cow print("\$$_"); # Prints $cow print(eval "$cow"); # Error executing "moo!". print(eval "\$cow"); # Prints moo! print(eval "\$$_"); # Prints moo!

    qq{...} is the same thing as "..."