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 +.