Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^2: DBI and fetchall_arrayref

by jethro (Monsignor)
on Feb 19, 2009 at 17:57 UTC ( #745144=note: print w/ replies, xml ) Need Help??


in reply to Re: DBI and fetchall_arrayref
in thread DBI and fetchall_arrayref

Small correction:

print $result->[0]->{'b'}."\n";


Comment on Re^2: DBI and fetchall_arrayref
Download Code
Re^3: DBI and fetchall_arrayref
by grinder (Bishop) on Feb 20, 2009 at 12:04 UTC
    Small correction

    Actually, $result->[0]{b} will work just fine as well. You don't need to dereference explicitly after the first one, nor do bareword keys need to be quoted.

    Concision, concision!

    • another intruder with the mooring in the heart of the Perl

Re^3: DBI and fetchall_arrayref
by Anonymous Monk on Feb 25, 2009 at 14:14 UTC
    you don't even need arrows or periods :)
    #!/usr/bin/perl -- use strict; use warnings; my $result = [ { b => 'small erection' } ]; print $result->[0]->{'b'}."\n"; print $result->[0]{b}."\n"; print "$$result[0]{b}\n"; print "$result->[0]{b}\n"; __END__ small erection small erection small erection small erection
      See perldoc DBI
        DBI

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2015-07-04 23:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls