in reply to How best to tell when my hash is "full" (all values defined)?
my @undefined = grep !defined $stats{$_}, keys %stats; if(@undefined { local $" = ", "; my $undefined = @undefined; warn "$undefined values were not defined, for keys (@undefined)\n" +; }
If you just want a simple count, not an elaborate report, you can use the simpler
my $undefined = grep !defined, values %stats; warn "$undefined values were not defined\n" if $undefined;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How best to tell when my hash is "full" (all values defined)?
by OfficeLinebacker (Chaplain) on Dec 18, 2006 at 15:08 UTC | |
by OfficeLinebacker (Chaplain) on Dec 18, 2006 at 15:26 UTC | |
by OfficeLinebacker (Chaplain) on Dec 18, 2006 at 15:41 UTC |