I would like to understand why the following script does not behave as expected.
In the script I had expected that $Bubba::abba would become an alias for $Hubba::abba, but that does not seem to be the case - so evidently %Bubba:: = %Hubba:: is not doing what I thought it would do....
Can someone explain the behaviour to me?
use strict; use Data::Dumper; # put something in package "Hubba" $Hubba::abba = "zappa\n"; # assign Hubba-symtable to Bubba-symtable %Bubba:: = %Hubba::; # verify that they are the same print Dumper(\%Hubba::); print Dumper(\%Bubba::); # use 2 ways to print $abba from Hubba print ${*Hubba::abba{SCALAR}}; # works print $Hubba::abba; # works print "and now Bubba:\n"; print ${*Bubba::abba{SCALAR}}; # prints nothing print $Bubba::abba; # print nothing
In reply to symboltable problem by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |