Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Accessing hash data via a reference

by samarzone (Pilgrim)
on Mar 21, 2011 at 12:04 UTC ( #894484=note: print w/replies, xml ) Need Help??


in reply to Accessing hash data via a reference

I am quite sure you haven't written use strict in your script. Furthermore you are not viewing warnings if use warnings is on

How can you get any value in "brokers" when you have declared "broker" in the start of the loop!!!

Even if it would have been "broker" it would give compile time error under use strict

When you write %$broker{'engineWeight'} it will try to find the value of $broker{'engineWeight'} and will append to '%'. Since there is no hash like %broker (mind it - it is hash reference $broker) it will throw a compile time error.

--
Regards
- Samar

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://894484]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2017-06-26 21:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (594 votes). Check out past polls.