Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Accessing variables in an external hash without eval

by marinersk (Priest)
on May 18, 2017 at 02:13 UTC ( [id://1190513]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Accessing variables in an external hash without eval
in thread Accessing variables in an external hash without eval

I still get an uninitialized variable for my @hashData.

Then it seems obvious that you're not loading a value with this line:

my @hashData  = $hash{Scope}{model};

Side note: This should probably read more like:

my @hashData  = @$hash{Scope}{model};

Never assume there is data where you expect it to be when it is coming from an outside source. Check it first. For example:

my @hashData = (); if (!defined $hash{Scope}{model}) { print "Scope and model missing!\n"; } else { @hashData = @$hash{Scope}{model}; }

...or something of that ilk.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-03-28 16:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found