Perl Monk, Perl Meditation | |
PerlMonks |
Re: Include Constants from other filesby Chmrr (Vicar) |
on Nov 13, 2002 at 07:31 UTC ( [id://212511]=note: print w/replies, xml ) | Need Help?? |
This is because of the way that use constant does its stuff -- it creates subroutines with empty prototypes in the current package. Here's one way to make it work; put the following lines in a file called Consts.pm:
In your main perl file (say, test.pl or somesuch) we'd say:
See perldoc constant for more information -- there's a section which describes exactly this (search for the word "package") perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'
In Section
Seekers of Perl Wisdom
|
|