Re: what "shift" does, if not "$_ = shift;" ?
- From: Joe Smith <joe@xxxxxxxxx>
- Date: Sun, 02 Dec 2007 17:05:25 -0800
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
.
- Prev by Date: Re: OT raibow
- Next by Date: Re: OT raibow
- Previous by thread: FAQ 4.71 How do I determine whether a scalar is a number/whole/integer/float?
- Next by thread: FAQ 4.12 How do I find the day or week of the year?
- Index(es):