[Perl] constant pragma question

Shlomo Yona shlomo at cs.haifa.ac.il
Tue Oct 22 07:50:42 PDT 2002


Hello,

Check this out:

perl -Mstrict -we 'use constant ARRAY => [ 1,2,3,4 ]; print ARRAY->[1]; ARRAY->[1] = " be changed"; print ARRAY->[1],"\n";'

prints out;

2 be changed

and this is totally not what I expected.

I expected to see:

" be changed"

Can someone explain? Where did the concatenation take place and why?

-- 
Shlomo Yona
shlomo at cs.haifa.ac.il
http://cs.haifa.ac.il/~shlomo/




More information about the Perl mailing list