in reply to Re^2: symbol table vs. eval
in thread symbol table vs. eval

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


--chargrill
$/ = q#(\w)# ; sub sig { print scalar reverse join ' ', @_ } + sig map { s$\$/\$/$\$2\$1$g && $_ } split( ' ', ",erckha rlPe erthnoa stJu +" );