Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re: no rows returned for dbi fetchall_arrayref

by Random_Walk (Prior)
on May 07, 2013 at 16:37 UTC ( #1032509=note: print w/ replies, xml ) Need Help??

in reply to no rows returned for dbi fetchall_arrayref

In one case you stringified it. In the other you are taking it in scalar context and Perl magic is not doing what you expect.

use strict; use warnings; use 5.010; my @array = qw (there is some data here); is_empty (\@array); # look out for edge cases @array = qw(one); is_empty(\@array); #empty it @array = (); is_empty (\@array); sub is_empty { my $array_ref = shift; say "\nGot: ". join ", ", @{$array_ref}; say "Empty" unless scalar @{$array_ref}; say "Caution" if $#{$array_ref} == 0; say "Empty" if $#{$array_ref} == -1; say "Maths == String?" if @{$array_ref} == ""; say "Empty as String?" if @{$array_ref} eq ""; }


Pereant, qui ante nos nostra dixerunt!

Comment on Re: no rows returned for dbi fetchall_arrayref
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2016-02-10 10:20 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (342 votes), past polls