Hello list,
I have some trouble understanding why a BEGIN block behaves the way it
does. Here are two files to demonstrate:
====== test =========
#!/usr/bin/perl
use warnings;
use strict;
use test2 qw($var);
our $var2 = 'second';
BEGIN {
print "I see $var but don't see $var2\n";
}
===== test2.pm =======
package test2;
use warnings;
use strict;
use Exporter;
our @ISA = qw (Exporter);
our @EXPORT_OK = qw ($var);
our $var = 'first';
1;
What makes the difference?
Thanks
Peter
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>