I read perldoc perlmod and from that everything in your example seems okay, except that I used Constants instead of My::Constants.
I tried perl -e 'use strict; use Constants; print $DB' and get an "Global symbol "$DB" requires explicit package name at -e line 1" :-(
I'm using perl 5.8.0
I found my mistake. Your example is perfectly right and I shouldn't use "My::Constants" in the package name when I name it "Constants" everywhere else.Thanks for your help!
In reply to Re: Re: variables / consts for different scripts
by Skeeve
in thread variables / consts for different scripts
by Skeeve
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |