in reply to Re: Re: the #include business
in thread the #include business
use also calls a class method called import every time it's encountered. You can use Exporter to make variables and functions available to other packages, or you can write your own import routine. I suggest the former.
package My::Constants; use vars qw( $x $y @EXPORT_OK @ISA ); use strict; use Exporter (); @EXPORT_OK = '$x'; @ISA = 'Exporter'; $x = 'my constant x is a lovable fellow'; $y = 'his ears are green and his belly is yellow'; 1;
It occurs to me that that's a lot of setup code. There's room for a nicer version of Exporter.
|
|---|