Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Scalar joining, concatenation, involving varying text

by mhearse (Chaplain)
on Jun 27, 2005 at 16:26 UTC ( [id://470375]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 16: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 "..."

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://470375]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.