moensch has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w { package jim; require Exporter; our @ISA = qw(Exporter); our $bar = 'foo'; our @EXPORT_OK = qw($bar); } package main; use strict; import jim qw/$bar/; print "our bar $::bar\n"; print "pkg ".__PACKAGE__." - bar: $bar\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Importing variables from package within same script
by chromatic (Archbishop) on Jan 14, 2010 at 21:11 UTC | |
by moensch (Novice) on Jan 15, 2010 at 15:17 UTC | |
|
Re: Importing variables from package within same script
by moensch (Novice) on Jan 15, 2010 at 15:11 UTC |