- or download this
use strict;
use vars qw($foo);
# ... code that uses $foo ...
1;
- or download this
use strict;
use Library;
# You can now use $foo freely.
- or download this
use vars qw($foo);
# Some code here.
package Bar;
# Now you can't use $foo, and won't accidentally access $main::foo.
- or download this
package Foo;
use strict;
...
our @EXPORT_OK = qw(foo);
# etc
1;
- or download this
package Foo;
use strict;
...
@EXPORT_OK = qw(foo);
# etc
1;
- or download this
package Foo;
use Exporter qw(import);
...
use strict;
# etc
1;