equivelent to vars.pm 
Author Message
 equivelent to vars.pm

Why does the following code generate the compile-time error about '$var'
not being imported, and it being a global, yadda yadda:

  BEGIN {
    *main::foo = \*main::foo;
  }
  use strict;
  $foo = 10;

... but when in any package OTHER than main (such as no package at all) it
works perfectly fine?

  BEGIN {
    package;
    *main::foo = \*main::foo;
  }
  use strict;
  $foo = 10;

--

http://www.*-*-*.com/ ~japhy/                   http://www.*-*-*.com/
PerlMonth - An Online Perl Magazine             http://www.*-*-*.com/
The Perl Archive - Articles, Forums, etc.     http://www.*-*-*.com/



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. use vars, vars.pm and Perl on NT

2. Vars, vars, vars...

3. Why cannot vars.pm be located?

4. Trouble finding "vars.pm" module

5. vars.pm in CORE for Win32 port?

6. Where is vars.pm

7. TimeDate-1.01: vars.pm????

8. bug in vars.pm?

9. HELP: CGI.PM + DBI Works if hardcoded/not w/vars

10. [Fwd: . /etc/profile equivelent]

11. 'flock' equivelent for NT

12. Unix 'Cat' equivelent

 

 
Powered by phpBB® Forum Software