in reply to symboltable problem

Its called magic :) There is a reason modules on cpan for this, see alias , namespace, and stash

use Data::Dump; $FOO::ONE = 1; *BAR:: = *FOO::; $BAR::ONE = 2; dd \%BAR::, \%FOO::; dd \*BAR::; __END__ do { my $a = { ONE => *FOO::ONE }; $a->{ONE} = \1; ($a, $a); } do { my $a = \*main::FOO::; *{$a} = { ONE => *FOO::ONE }; *{$a}{HASH}{ONE} = \1; $a; }

use Data::Dump::Streamer; $FOO::ONE = 1; *BAR:: = *FOO::; $BAR::ONE = 2; Dump \%BAR::, \%FOO::; Dump \*BAR::; __END__ $HASH1 = { ONE => *FOO::ONE }; *FOO::ONE = \do { my $v = 1 }; $HASH2 = $HASH1; $GLOB1 = \*{'::FOO::'}; *{'::FOO::'} = { ONE => *FOO::ONE }; *FOO::ONE = \do { my $v = 1 };

Replies are listed 'Best First'.
Re^2: symboltable problem
by morgon (Priest) on Jun 20, 2012 at 17:37 UTC
    My problem is not to learn how to achieve an alias but to understand the behavour of the script supplied.