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.
In reply to Re: Re: Re: the #include business
by chromatic
in thread the #include business
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |