Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: no rows returned for dbi fetchall_arrayref

by Random_Walk (Parson)
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 making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2015-01-31 13:14 GMT
Find Nodes?
    Voting Booth?

    My top resolution in 2015 is:

    Results (258 votes), past polls