Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Frontier::Client mystery result string hash

by jbrugger (Parson)
on Feb 16, 2005 at 05:44 UTC ( #431448=note: print w/replies, xml ) Need Help??


in reply to Re: Frontier::Client mystery result string hash
in thread Frontier::Client mystery result string hash

Why would this be cleaner? You've got a reference to an array, containing a hash, meaning it only exists 1 time in your memory.
Now you're dereferencing it into another hash, resulting in being twice in the memory. Do this with larger hashes over and over, and the memory usage becomes bigger and bigger.
Print city: $result->[0]{'city'}\n"; is a verry legitimate way to write the results, i'd like the iterative way even more, in $result->[1] may be another hash, so i'd use ikegami's approach:
foreach $record ( @{$result} ) { foreach $field (keys %$record) { printf("%s: %s\n", $field, $record->{$field}, ); } print("\n"); }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2022-05-29 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?