Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Different result for 'foreach' vs 'while shift' arrayref

by gvandeweyer (Initiate)
on Apr 18, 2014 at 09:38 UTC ( [id://1082739]=note: print w/replies, xml ) Need Help??


in reply to Different result for 'foreach' vs 'while shift' arrayref

It turned out that there were a few undef elements in the rowcache. Thank you for the pointers!
geert
  • Comment on Re: Different result for 'foreach' vs 'while shift' arrayref

Replies are listed 'Best First'.
Re^2: Different result for 'foreach' vs 'while shift' arrayref
by AnomalousMonk (Archbishop) on Apr 18, 2014 at 23:14 UTC
    ... there were a few undef elements in the rowcache.

    Use of warnings would have enabled Perl to alert you to this situation, and
        use warnings FATAL => 'all';
    would have put a quick and merciful end to it.

    c:\@Work\Perl>perl -wMstrict -le "use warnings FATAL => 'all'; ;; my $hr = { foo => 'bar' }; my @ra = ($hr, $hr, undef, $hr, $hr); ;; for my $hashref (@ra) { print qq{foo is '$hashref->{foo}'}; } " foo is 'bar' foo is 'bar' Use of uninitialized value in concatenation (.) or string at -e line 1 +.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-23 05:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found