develooper Front page | perl.perl5.porters | Postings from December 2000

[ID 19991103.005] Spurious 'Modification of a read-only value'

From:
Stephen P. Potter
Date:
December 13, 2000 10:51
Subject:
[ID 19991103.005] Spurious 'Modification of a read-only value'
Message ID:
200012131853.NAA05809@spotter.yi.org
Still in 8101....

        perl -we 'defined ${$1}'

 gives the errors

         Useless use of defined operator in void context at -e line 1.
         Modification of a read-only value attempted at -e line 1.

 Simpler examples give the expected warnings

         perl -we '${$1}'
         Useless use of a variable in void context at -e line 1.
         Use of uninitialized value at -e line 1.

         perl -we 'defined ${+undef}'
         Useless use of defined operator in void context at -e line 1.
         Use of uninitialized value at -e line 1.

 This didn't happen in perl5.003 FWIW.    Something to do with
 autovivication of references to scalars?



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About