in reply to Include Constants from other files
Because said subroutine only exists in the namespace of your header file, your main program cannot access it. There are however a number of ways for your program to access this constant. Assuming header.pm contains your constants, and program.pl is your script
Program.pl can then use header; and just access camel as normal.package header; @ISA=('Exporter'); @EXPORT=('camel'); use constant camel => 'flea-ridden'; 1; # I'm a well-behaving module
# program.pl use header; *header::camel=*::camel; print &camel; # Note that you have to call camel as a function here.
CU
Robartes-
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Include Constants from other files
by gregor-e (Beadle) on Dec 01, 2002 at 04:11 UTC |