in reply to Re: bareword and hash reference
in thread bareword and hash reference

Hi,

Yep, you are correct, and this means that

$a{test}="ENV"; $a{test}{this}="strange"; die if ENV->{this} eq $ENV{this};
this dies??

I really need some coffee now.
---------------------------
Dr. Mark Ceulemans
Senior Consultant
IT Masters, Belgium

Replies are listed 'Best First'.
Re: Re: Re: bareword and hash reference
by fruiture (Curate) on Aug 22, 2002 at 14:30 UTC

    Exactly. I conclude 'string -> {key}' equals '$string{key}' and is a symbolic reference, for 'string' is an at runtime determined name, and that's bad.

    --
    http://fruiture.de

      fruiture++

      Using Deparse shows that that's just what happens:

      perl -MO=Deparse scratch.pl $a{'test'} = 'very '; $a{'test'}{'this'} = 'strange'; print $a{'test'}; print $very {'this'};