dear perlmonks,
i want to create a constant file and use it without the package name in other file. this is what i did,
///// MyConst.pm ////////////
package MyConst;
use Readonly;
Readonly::Scalar $const1 => 1;
///////// END ////////////
////// test.pl /////////
use MyConst;
print $const1;
////////// END //////////
i got this error:
"Global symbol "$const1" requires explicit package name at MyConst.pm line 4
it doesn't matter if i call "$const1" or "$MyConst::const1", same error as above, maybe i just don't understand Perl namespace, any help will be greatly appreciated.
Thanks!