-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spurious 'Modification of a read-only value' #808
Comments
From mjtg@cus.cam.ac.ukgives the errors Useless use of defined operator in void context at -e line 1. Simpler examples give the expected warnings perl -we '${$1}' perl -we 'defined ${+undef}' This didn't happen in perl5.003 FWIW. Something to do with Mike Guy % perl5.005_62a -V Characteristics of this binary (from libperl): |
From [Unknown Contact. See original ticket]Still in 8101.... perl -we 'defined ${$1}' gives the errors Useless use of defined operator in void context at -e line 1. Simpler examples give the expected warnings perl -we '${$1}' perl -we 'defined ${+undef}' This didn't happen in perl5.003 FWIW. Something to do with |
From @floatingatoll[RT_System - Wed Dec 13 02:51:31 2000]:
Still in 18374. |
From @schwern[coral - Sun Jul 6 15:16:33 2003]:
Still in 5.8.1 RC2 |
From @schwernStill in 25129. $ bleadperl -wle 'defined ${$1}' |
From @obraOn Tue Jul 12 19:57:31 2005, schwern wrote:
Still present in 5.11.0. [jesse@mar-adentro ~ (master)]$ /usr/local/bin/perl5.11.0 -wle 'defined |
From @ikegamiI don't see how this is a bug. Attempting to autovivify a constant Autovivification occurs when dereferencing an undefined scalar when an By the way, there's nothing special about defined() or $1. Any lvalue ----- BEGIN CODE ----- use Readonly; eval { sub {}->( $$x ) }; print $@ || "ok\n"; ----- BEGIN OUTPUT ----- |
From @davidnicolthis appears to be working as documented at On Mon, Dec 14, 2009 at 4:26 PM, Eric Brine via RT
-- |
From @ikegamiOn Wed, Dec 16, 2009 at 4:29 PM, David Nicol <davidnicol@gmail.com> wrote:
Exactly. with C<no strict 'refs'> does the
No. That would require $x="" instead of $x=undef. $ perl -e'$x = undef; $$x = "abc"; print qq!\$x = $ perl -e'$x = ""; $$x = "abc"; print qq!\$x = |
From @davidnicolOn Wed, Dec 16, 2009 at 3:42 PM, Eric Brine <ikegami@adaelis.com> wrote:
I am surprised. Is /this/ a bug? -- |
From @ikegamiOn Thu, Dec 17, 2009 at 11:34 AM, David Nicol <davidnicol@gmail.com> wrote:
That you can create a var named (empty string)? Perhaps, but I don't think In fact, the ability to create illegally named variables is used as a Or maybe you are referring to the difference between undef and "". As far as - ELB |
From @davidnicolOn Thu, Dec 17, 2009 at 11:39 AM, Eric Brine
I expect undef to always stringify to the empty string, and I expect So to force stringification for symbolic reference, doublequotes have # perl -le '$$x=123;$r="$x";print "$r symderefs to ${$r}"' i vaguely remember getting the idea at some point that the reference That isn't a bug either. |
From @ikegamiNoone voiced any disagreement with my previous statement that Perl is Furthermore, one can use "no autovivification;" to get the warning the $ perl -we'no autovivification; my $ perl -we'my This ticket should be closed unless this ticket is suppose to be a about |
@ikegami - Status changed from 'open' to 'rejected' |
Migrated from rt.perl.org#1735 (status was 'rejected')
Searchable as RT1735$
The text was updated successfully, but these errors were encountered: