Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?
[Corion]: Hi marto!
[Corion]: I hope you were able to catch up on some sleep
Corion is slowly, slowly relaxing. Yesterday I spent vegging out in front of the PC, today at a friends, and hopefully I have the books for our Perl club done by Monday. I guess I'll only really relax once I get back from LPW
[marto]: last night, well this morning was a 5am finish, up from 4 am the previous day. Oddly I feel better today than I did yesterday

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-11-19 11:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (279 votes). Check out past polls.

    Notices?