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.