Stupid Perl Tricks
Tim Hammerquist September 10, 2012 #perl... wherein we demonstrate the wholesale assignment of an external package's symbol table to a lexical hash. We further demonstrate that bidirectional manipulation of the external package is possible.
In fact, the lexical scalar becomes a hashref to the symbol table itself...
;
;
;
$bar = ;
$baz = ;
;
my $stuff = \;
. $stuff-> . ;
. $stuff-> . ;
;
;
. . ;
. . ;
{
;
$bar2 = ;
$baz2 = ;
;
= *bar2;
= *baz2;
}
;
;
. . ;
. . ;