in reply to How do I pass refs to tied vars ?
In your code, you make tied(%b), where %b isn't %main::b, it's my (%b).
So, to fix your code, just change:
And now you can see the output:## From: my(%a, %b); ## To: my %a ; use vars qw(%b) ;
If you want to work with the reference to the tied HASH, use:tied a tied b
Or use Lexical::Alias, as japhy said. :-Pmy $b = \%a; tied(%$b) ;
Graciliano M. P.
"The creativity is the expression of the liberty".
|
|---|