Greetings.

I am afraid this is rapidly becoming less than relevant, however..

> -----Original Message-----
> From: Stas Bekman [mailto:[EMAIL PROTECTED]]
[...]
> You have to declare variables as globals before using them. 

Agreed 

> Even the imported ones. That's a pure perl issue. Please proceed to the
perl 
> lists/groups/monks for further discussion.

This is a bit of a surprise.... the following, in fact, runs just fine:

--Foo.pm--
package Foo;
use strict;
use warnings;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = ( qw( $foo ) );
our @EXPORT = qw();
our $VERSION = '0.01';
our $foo=1;
1;

--usefoo.pl
use strict;
use warnings;
use Foo qw($foo);
print "foo is $foo\n";

$ perl usefoo.pl
foo is 1

This is according to my instinct - and practice: I have been using this
idiom, under strict, for the longest time and the interpreter has never
raised an eyebrow about it. BTW, this also works with @IMPORT (not only with
@IMPORT_OK). I cannot give you a doc pointer that explicitely says that it
must be so (or why), though. 

Cheers,
alf

Reply via email to