in reply to Can't use an undefined value as an ARRAY...

I'm with cog on this one. I can't make heads or tails as to what you are trying to do here. Note that use of $a and $b should be limited to sort, but that shouldn't cause the "problem" ... if there even is one. I boiled your code down and it seems ... fine?

use strict; use warnings; use Data::Dumper; my $entries = []; push(@{$entries}, { a => 1, b => undef}); foreach (my $i=0; $i<scalar(@{$entries}); $i++) { print Dumper $entries->[$i]; }

Although i would rewrite the foreach loop as such:

for my $i (0 .. $#$entries) { print Dumper $entries->[$i]; }
TIMTOWTDI.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)