Tom Christiansen <tchrist@chthon.perl.com> wrote > #!/usr/bin/perl -wl > @cast = ( > { name => "pebbles", age => 2, role => "kid" }, > { name => "wilma", age => 31, role => "wife" }, > { name => "fred", age => 36, role => "husband" }, > ); > print @cast->{age}->{name}; > > The result here, you see, is "fred", rather than the far more > readily expected "HAVE YOU LIKE COMPLETELY LOST YOUR MIND?". Well, I expected "fred". But then, I'm AVHV aware. I have lots of data structures like that (arrays of hashes), and I regularly find that some minor bug of mine causes Perl to dive into the AVHV code with sometimes surprising consequences (including SEGVs). > For a good time, try to guess without running it, what prints > out if you interchange the subscripts: > > print @cast->{name}->{age}; Without running it, I couldn't guess exactly which error it would stop on, but otherwise ... > Yes, these are all bugs, not features. But hard to fix. Nope. Once you've accepted @x->[2] as a shorthand for (\@x)->[2], these are all features. But AVHV is of course still experimental. And it would be easy to fix - just remove AVHV. :-) Mike Guy