develooper Front page | perl.perl5.porters | Postings from March 2000

'use vars' incompatibility!

Thread Next
Unknown Sender
March 5, 2000 01:40
'use vars' incompatibility!
Message ID:
$ eperl -w -e '
   use strict;
   use vars '$foo';
   BEGIN {
      *foo = \$some::var;
   print "$foo\n";
Variable "$foo" is not imported at -e line 8.
Global symbol "$foo" requires explicit package name at -e line 8.
Execution of -e aborted due to compilation errors.

Replacing "use vars" with the equivalent "our" works and prints "bar".
So did the above code in 5.005_03.

Matthias Urlichs  |  noris network GmbH   |  |  ICQ: 20193661
The quote was selected randomly. Really.    |
The ends justify the means.
               --after Matthew Prior

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About