in reply to How to correctly import variables to a module ?
package LinuxCommandsPaths; use strict; use vars qw( @ISA @EXPORT_OK $cat $cleartool $chkconfig ); require Exporter; @ISA = qw(Exporter); @EXPORT_OK = qw( $cat $cleartool $chkconfig ) ; our $cat = '/bin/cat'; our $cleartool = '/usr/atria/bin/cleartool'; our $chkconfig = '/sbin/chkconfig'; 1;
#!/usr/bin/perl -iw # use strict; use vars qw( $cat $cleartool $chkconfig ); use LinuxCommandsPaths qw($cat $cleartool $chkconfig); print "\$cat == |$cat|\n"; print "\$cleartool == |$cleartool|\n"; print "\$chkconfig == |$chkconfig|\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to correctly import variables to a module ?
by ronbarak (Novice) on Dec 13, 2006 at 09:15 UTC |