David Dyck wrote: > On Thu, 30 Jun 2005 at 15:51 +0200, Rafael Garcia-Suarez wrote: > > > David Dyck (via RT) wrote: > >> > >> The following 3 line test program results in the same error when pushing > >> __PACKAGE__ > >> onto @ISA: > >> our @ISA = qw(a b); > >> push @ISA, 'main'; > >> push @ISA, __PACKAGE__; > >> > >> "Modification of a read-only value attempted at isabug.pl line 3." > >> > >> Renaming the @ISA variable makes the error message go away. > > > > I can reproduce this with other magic variables as well : > > > > $ ./perl -e '%ENV = (PATH => __PACKAGE__)' > > Modification of a read-only value attempted at -e line 1. > > Thanks for the patch. > > Before I applied the patch, I tried another experiment > using B::Deparse and was surprised to see that > all 3 "push" lines deparse the same. > If the line deparses the same, than why wast the > error message only issued for the "push @ISA, __PACKAGE__" line?
Because __PACKAGE__ is a constant. Use Devel::Peek to peek at it.