Hrm. Note where I declare vars:
package apackage; my $test="my_variable_name"; my $default_value="the value I set"; $$test = $default_value; print "the value of \$my_variable_name = $my_variable_name\n"; package main; $my_variable_name = "A new value"; our $test; print "the value of \$my_variable_name = $my_variable_name\n"; print "the value of the package variable = $apackage::my_variable_name +\n";
Yields:
the value of $my_variable_name = the value I set the value of $my_variable_name = A new value the value of the package variable = the value I set
$/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );
In reply to Re^3: symbol table vs. eval
by chargrill
in thread symbol table vs. eval
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |