Re: what "shift" does, if not "$_ = shift;" ?



devphylosoff wrote:

print map {" @{$_} \n"} values %all;
check_items_for_all(\%all);
print map {" @{$_} \n"} values %all;

So, you're expecting $_ to be unchanged after calling check_items_for_all().
It won't be, based on the code you commented out.

You'd need
local $_ = shift;

Or better yet, use a private lexical variable instead of the global $_ variable.
my $href = shift;
for $key (keys %$href) {
check_required_items($key, $href->{$key});
}

-Joe
.