Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Using Exporter with a complex hash

by Don Coyote (Pilgrim)
on Oct 23, 2012 at 22:49 UTC ( #1000531=note: print w/replies, xml ) Need Help??


in reply to Using Exporter with a complex hash

As you are accessing the 'code' key, this is not an exporter issue. But im really glad the our my difference was pointed out here as I just wrote my first object tonight!!

NetWallah has given you a correct way of accessing the array value from the hash of the hash, the hashtable name is a bit misleading. The data is just a complex hash.

you have to access the values depending on the context of the value. If you want the whole array, access in the way NetWallah has shown, and in a similar fashion you can also access the subscripts. Put back into the code of the op...

print qq(\n), @{ $hash{'STATION1'}->{'parameters'} } ; print qq(\n), $hash{'STATION1'}->{'parameters'}[0] ; ------- abcd a

I tried to export through my new object script into my calling script but did not have a lot of success, I just pasted into my calling script to test this. Oh yeah, works if I update lexical my to package our. nice!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1000531]
help
Chatterbox?
[stevieb]: been thinking... if it wasn't for Perl, I believe that I'd be done in tech. I don't do social media or the like, if I'm not coding I'm not on a device at all, and don't miss comms at all when I'm not around. I code for my job (which I like), but I think..
[stevieb]: ...I haven't coughed up my laptop because of Perl.
[stevieb]: I think that Perl is the reason that I haven't gone 100% off grid :)

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (3)
As of 2017-03-29 02:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (343 votes). Check out past polls.