http://qs1969.pair.com?node_id=1218894


in reply to Constants lists in array slices

answering my own question:

Testing with 5.24 shows constant folding of lists to work:

X:\>perl -MO=Deparse -e"use constant L=>1,2,3; print @a[L]" use constant ('L', 1, 2, 3); print @a[1..3]; -e syntax OK

seems like constant folding of lists was only added "some years" ago. ;-)

update

for comparison 5.18

D:\>perl -MO=Deparse -e"use constant L=>1,2,3; print @a[L]" use constant ('L', 1, 2, 3); print @a[L()];

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice