vr has asked for the wisdom of the Perl Monks concerning the following question:
I'm experimenting, idly, with lvalues, but instead it looks like some dreadful, purely syntactic, confusion:
use strict; use warnings; use feature 'say'; my $p = 'abc'; my $q = 'abc'; substr(( substr( $p, 0, 1 ) = '123' ), 0, 1 ) = 'x'; substr((( substr $q, 0, 1 ) = '123' ), 0, 1 ) = 'x'; say $p; say $q;
x23bc 123bc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Why Perl gets confused here?
by NetWallah (Canon) on Oct 26, 2017 at 05:57 UTC | |
by Anonymous Monk on Oct 26, 2017 at 20:54 UTC | |
by ikegami (Patriarch) on Oct 26, 2017 at 22:34 UTC | |
|
Re: Why Perl gets confused here?
by ikegami (Patriarch) on Oct 26, 2017 at 22:07 UTC | |
by vr (Curate) on Oct 27, 2017 at 13:49 UTC | |
by LanX (Saint) on Oct 27, 2017 at 14:18 UTC | |
|
Re: Why Perl gets confused here?
by LanX (Saint) on Oct 26, 2017 at 22:16 UTC | |
|
Re: Why Perl gets confused here?
by LanX (Saint) on Oct 26, 2017 at 21:32 UTC |