http://www.perlmonks.org?node_id=904244


in reply to "Using a hash as a reference is deprecated" -- Baloney !

Due to a bug in Perl,

%foo->{bar}

gets interpreted as a

(\%foo)->{bar}

->{bar} expects a reference, and thus a scalar, so it should be interpreted as

scalar(%foo)->{bar}

The deprecation warning was added in anticipation of getting this bug fixed.

Since

%{$WAI->getMem()}->{'MemTotal'}

is getting interpreted as

\%{$WAI->getMem()}->{'MemTotal'}

you could use that, or you could shorten it to

$WAI->getMem()->{'MemTotal'}

Now where's this baloney you promised? I'm hungry!

Update: Fixed bad curlies matching in second half.

Replies are listed 'Best First'.
Re^2: "Using a hash as a reference is deprecated" -- Baloney !
by Anonymous Monk on May 11, 2011 at 20:40 UTC
    Awesome. Excellent explanation, I had no idea this was a planned bugfix. Thanks everyone ! Here's the promised "baloney" :)
    Balogna ("baloney") and cheese: _.---._ _.-~ ~-._ _.-~ ~-._ _.-~ ~---._ _.-~ ~\ .-~ _.; :-._ _.-~./ }-._~-._ _..__.-~_.-~ ) `-._~-._~-._ / ...-~H.-~ ~-nad.._\. _.-~ .:::: // ~-. \`--...--~ _.-~__...==~ \.`--...---+-~~~~~ ~-..----~ How about a deli style turkey sandwich (damn I'm hungry now!): _.---._ _.-~ ~-._ _.-~ ~-._ _.-~ ~---._ _.-~ ~\ .-~ _.; :-._ _.-~ ./ `-._~-._ _..__.-~ _.-~ / ~-._~-._ / .__..--~----._ \_____(_;-._\. _.-~_/ ~).. . \ /(_____ \`--...--~_.-~______..-+_______) .(_________/`--...--~/ _/nad /\ /-._ \_ (___./_..-~__.....__..-~./ `-._~-._ ~\--------~ .-~_..__.-~ _.-~ ~-._~-._ ~---------' / .__..--~ ~-._\. _.-~_/ \`--...--~_.-~ `--...--~ Gotta have something to wash that down with... _ // // _______________//__ .(______________//___). | / | |. . . . . . . / . . .| \ . . . . . ./. . . . / | / ___ | _.---._ |::......./../...\.:| _.-~ ~-._ |::::/::\::/:\::::::| _.-~ ~-._ |::::\::/::::::X:/::| _.-~ ~---.;:::::::/::\::/:::::| _.-~ ~\::::::n::::::::::| .-~ _.;::/::::a::::::::/ :-._ _.-~ ./::::::::d:::::::| `-._~-._ _..__.-~ _.-~|::/::::::::::::::| / ~-._~-._ / .__..--~----.YWWWWWWWWWWWWWWWP' \_____(_;-._\. _.-~_/ ~).. . \ /(_____ \`--...--~_.-~______..-+_______) .(_________/`--...--~/ _/ /\ /-._ \_ (___./_..-~__.....__..-~./ `-._~-._ ~\--------~ .-~_..__.-~ _.-~ ~-._~-._ ~---------' / .__..--~ ~-._\. _.-~_/ \`--...--~_.-~ `--...--~

    credit to : Nate / DAC for the artwork !