> Try this:
>
>   use strict;
>   print "Global \$main::foo is at ", \$main::foo, "\n";
>   our $foo = 'One';
>   print "a: addr=", \$foo, ", val=$foo\n";
>   {
>       our $foo = 'Two';
>       print "b: addr=", \$foo, ", val=$foo\n";
>   }
>   print "c: addr=", \$foo, ", val=$foo\      --Bob

Hi Bob,

Well, I tried it, and a few permutations thereof, and the only real difference I see 
with our is that the our makes the inner declaration a comment. Without the 
declaration of a local [not Perl local, just local] variable in the block, the block 
would have full access to the variable, anyway.

This has certainly been most instructive.  It also makes me very leery about declaring 
anyvariables outside of function definitions.  I just don't see any real porotection 
coming from the my keyword alone.

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to