On 05 Mar 2009 00:07:10 +0200, Shmuel Fomberg wrote:
>
> Today I've seen a weird behavior in a program. I had something like:
>
> our @list = qw{one two three};
>
> use constant VAR => {
> map( { ( $_ => 16 ) } @list ),
> };
>
> I theorized that it is because "use constant" is set in compile time,
> and @list is empty in that time. @list is populated in run-time, but
> that is too late for VAR.
Another alternative to what was suggested already is to be consistent:
use constant LIST => qw(one two three);
use constant DOUBLE_LIST => LIST, LIST;
Regards,
Mikhael.
--
perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'
_______________________________________________
Perl mailing list
[email protected]
http://perl.org.il/mailman/listinfo/perl