Is your collection an array-like (not keyed) or hash-like (keyed)? If your collection is hash-like, this would be trivial.
my @must_haves = qw( apple orange pear ); foreach my $collection (@collections) { foreach my $must_have (@must_haves) { $collection->{$must_have} = ... if not exists $collection->{$must_have}; } }
If your collection is array-like, it's simplest to create a hash from it. See jhourcle's reply for an implementation.
In reply to Re: are they all there?
by ikegami
in thread are they all there?
by anadem
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |