in reply to Re: Type globs, strict, and lexical variables
in thread Type globs, strict, and lexical variables
sub cc, happens to use the same dummy variable name $tmp. as a result as the local expression $f gets clobbered. What I want is something that makes $tmp scoped like a my variable.my $f = "boot"; {local *tmp =\$f; $tmp = "loop"; GG::cc () ;print "$f\n...\n"}; sub cc { $tmp="cc did it"}; print "$f\n...\n";
THe problem I am trying to solve here is simply to always have to write de-reference code when I pass in a reference. I want an alais in the form of a localy scoped variable to the object being dereferenced. It looks like you might be able to do this with a tie or with Data::alias but those are both very heavyweight solutions.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Type globs, strict, and lexical variables
by ikegami (Patriarch) on Jul 17, 2006 at 17:10 UTC | |
|
Re^3: Type globs, strict, and lexical variables
by xmath (Hermit) on Jul 19, 2006 at 09:16 UTC | |
|
Re^3: Type globs, strict, and lexical variables
by ysth (Canon) on Jul 20, 2006 at 00:58 UTC |