targetsmart has asked for the wisdom of the Perl Monks concerning the following question:
other codeperl -e "%package = ( 'zips' => {1,2,3,4} ); print %package->{zips};"
both the one liners printperl -e "%package = ( 'zips' => {1,2,3,4} ); print $package{zips};"
but when I enable warning(-w) the former producesHASH(0x23bbe4)
Using a hash as a reference is deprecated at -e line 1.
I thought only the later should work, the former should fail, but it is also working but outputs along with a warning. can anyone tell me what happens if I do like %package->{key} considering the above example.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: hash reference doubt
by davorg (Chancellor) on Jul 20, 2009 at 09:46 UTC | |
by targetsmart (Curate) on Jul 20, 2009 at 09:51 UTC | |
by davorg (Chancellor) on Jul 20, 2009 at 10:05 UTC | |
by CountZero (Bishop) on Jul 20, 2009 at 13:53 UTC | |
Re: hash reference doubt
by jethro (Monsignor) on Jul 20, 2009 at 09:50 UTC | |
Re: hash reference question
by cdarke (Prior) on Jul 20, 2009 at 12:40 UTC |