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

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 ""; }

Cheers,
R.

Pereant, qui ante nos nostra dixerunt!


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2014-10-21 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (95 votes), past polls