in reply to Re: Can't localize lexical variable $var at...
in thread Can't localize lexical variable $var at...
I've always been a little confused as to why this was implemented for elements of a lexical hash or array but not scalar#!/usr/bin/perl use warnings; my %hash = (a=>1, b=>2); { local $hash{'a'} = 999; print map {"$_ = $hash{$_}, "} sort keys %hash; print "\n"; } print map {"$_ = $hash{$_}, "} sort keys %hash; print "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Can't localize lexical variable $var at...
by Elian (Parson) on Jun 10, 2002 at 07:18 UTC |