in reply to references to empty arrays

When you wonder what your array looks like, you can always just look. When things don't make sense, look at the data directly. If the data is what you expect but you still get the wrong answers, the problem must be something else.

use Data::Dumper; my $array_ref = []; print STDERR Dumper( $array_ref );
--
brian d foy <brian@stonehenge.com>
Subscribe to The Perl Review

Replies are listed 'Best First'.
Re^2: references to empty arrays
by ayrnieu (Beadle) on Feb 15, 2006 at 07:16 UTC

    It is also wise to learn to use the perl debugger.

    Pseudodebug:

    perl -d program DB<0> c M::N::suspicious_subroutine DB<0> n DB<0> n DB<0> n DB<0> use Data::Dumper DB<0> p Dumper($aref)