Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: access array of hash?

by Happy-the-monk (Abbot)
on Mar 22, 2012 at 20:21 UTC ( #961093=note: print w/replies, xml ) Need Help??


in reply to access array of hash?

the answers are in perldoc perldsc and perldoc perllol

Assuming your array is called @array, this might do it:

for my $i ( 0 .. $#array ) { next unless $array[$i]->{ServiceType} eq 'FEDEX_2_DAY'; print $array[$i]->{ship_cost} and last; }

Cheers, Sören

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://961093]
help
Chatterbox?
[LanX]: met a guy from Aberdeen durin holidays, liked Scotsish accent a lot ... very phonetic
[LanX]: ... understood everything after mentally write down what he said.
[choroba]: Trainspotting?
[choroba]: Ouch, trailing commas in JSON :-(
[LanX]: ... though there seems to exist a taxation for the letter 't' in Northern Bri''ain ;-)
[LanX]: never seen trainspotting in OV ... :(
[karlgoethebier]: LanX

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2018-02-19 10:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (261 votes). Check out past polls.

    Notices?