On Fri, 16 Feb 2007 12:52:50 +0100, cz172638 wrote:
> use constant TESTERCONFIG => %testerscfg;
>
> foreach $b (keys %testerscfg) {
> print $b."\n";
> }
>
> it works well, but when i put in foreach loop instead of %testerscfg
> TESTERCONFIG
> i got following:
>
> Type of arg 1 to keys must be hash (not subroutine entry) at testik.pl line
> 52, near "TESTERCONFIG) "
>
> question is: how to setup hash constant from file?
It's not worth the trouble of doing this with constant.pm. Use
Readonly.pm instead:
use Readonly;
Readonly my %TESTERCONFIG => ...;
--
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/