The following is my personal LiveJournal and as such has little if any Perl content, but I link it here precisely to demonstrate how easy it is to do: bigmacbear. I keep my publically accessible stuff clean but friends-only stuff may not be safe for work.
Wondering why this construct returns as many empty elements as are present in the argument of keys(), instead of nothing, when %found and %good are identical:
@bogus = map { $_ if !defined $good{$_}; } keys %found;
@missing = map { $_ if !defined $found{$_}; } keys %good;
Answer: use grep instead of map. per merlyn and ysth, grep selects and map transforms.
|