Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: "Using a hash as a reference is deprecated" -- Baloney !

by kennethk (Abbot)
on May 11, 2011 at 20:15 UTC ( #904240=note: print w/replies, xml ) Need Help??


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

If getMem() is returning a hash reference, then you are dereferencing the hashref into a hash with %{ ... } and then dereferencing a second time using The Arrow Operator, thus the warning. The preferred syntax would be:

sub get_memory_tot { return $WAI->kBToMB($WAI->getMem()->{'MemTotal'} ); } sub get_memory_free { return $WAI->kBToMB( $WAI->getMem()->{'MemFree'} ); } sub get_swap { return $WAI->kBToMB( $WAI->getMem()->{'SwapTotal'}); }

See perlref and/or perlreftut for more explanation.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://904240]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2022-01-19 16:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (55 votes). Check out past polls.

    Notices?