Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Questions about context

by davido (Cardinal)
on Jan 30, 2005 at 05:04 UTC ( [id://426344]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Questions about context
in thread Questions about context

Hashes don't interpolate in double-quoted strings. That's the first reason it doesn't work. The second reason is that hashes need an even number of elements, and you're generating an odd number of elements.

To illustrate both of those points, try the following:

my %hash = ( one => 1, two => 2 ); print "%hash\n"; # See, it doesn't interpolate. %hash = ( localtime )[5]; # Now you get a warning about uneven number +of elements.

Far more than you ever wanted to know about string interpolation is described in perlop.


Dave

Replies are listed 'Best First'.
Re^4: Questions about context
by qq (Hermit) on Jan 30, 2005 at 19:53 UTC

    Far more than you ever wanted to know about string interpolation is described in perlop.

    And yet more in MJD's Identity.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://426344]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (1)
As of 2024-04-25 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found