Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Returning data

by BillKSmith (Monsignor)
on Apr 21, 2024 at 21:23 UTC ( [id://11159015]=note: print w/replies, xml ) Need Help??


in reply to Returning data

The following code explicitly stores the list of hash refs into the array referenced by $output{items}.
use strict; use warnings; use Data::Dumper; my $Data = # simulated output of fetchall_arrayref() [ [ 'Valls', ('more fields')], [ 'AUT15605', ('more fields')], [ '10UT15605', ('more fields')], ]; my %output; @{$output{items}} = map { {title => $_->[0]} } @$Data; print Dumper(\%output);
Bill

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2026-04-10 22:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.