Because the variable in the package is declared within the scope of that package. So basically you now have two variables:
$MYPACKAGE::var1 contains 'DEFAULT I WANT TO CHANGE'
$main::var1 contains 'PRINT THIS'.
You need to peruse perlvar and the docs for the package command.
In reply to Re: changing package variables?
by jasonk
in thread changing package variables?
by LameNerd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |