Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I have a variable, $rtn, that looks like this when I print it with Data Dumper:
$VAR1 = [ { 'ship_cost' => '80.84', 'ServiceType' => 'FIRST_OVERNIGHT', 'ship_note' => 'Overnight Delivery by 8:00 or 8:30 am', 'ship_tag' => 'First Overnight' }, { 'ship_cost' => '43.71', 'ServiceType' => 'PRIORITY_OVERNIGHT', 'ship_note' => 'Overnight Delivery by 10:30 am', 'ship_tag' => 'Priority Overnight' }, { 'ship_cost' => '38.74', 'ServiceType' => 'STANDARD_OVERNIGHT', 'ship_note' => 'Overnight Delivery by 3:00 pm', 'ship_tag' => 'Standard Overnight' }, { 'ship_cost' => '17.5', 'ServiceType' => 'FEDEX_2_DAY', 'ship_note' => '2 Business Days Delivery by 4:30 pm', 'ship_tag' => 'Fedex 2 Day' }, { 'ship_cost' => '13.63', 'ServiceType' => 'FEDEX_EXPRESS_SAVER', 'ship_note' => '3 Business Days Delivery by 4:30 pm', 'ship_tag' => 'Fedex Express Saver' }, { 'ship_cost' => '7.75', 'ServiceType' => 'FEDEX_GROUND', 'ship_note' => '1-5 Business Days Delivery day based on di +stance to destination', 'ship_tag' => 'Fedex Ground' } ];
I've tried everything I can think of to access the nested contents. I need to know the ship_cost for the Fedex 2 Day service. How do I go about referencing that entry? Thank you so much for your help. Dunc

In reply to access array of hash? by DuncIT

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2024-04-19 15:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found