>Uri Guttman wrote:
>>
>> TC> ($this = $that) =~ s/foo/bar/;
>> TC> for (@these = @those) { s/foo/bar/ }
>>
>> TC> You can't really do those in one step without it.
>RFC 164 v2 has a new syntax that lets you do the above or, if you want:
> $this = s/foo/bar/, $that;
> @these
Uri Guttman wrote:
> but we need a better syntax for s/// that doesn't modify its string but
> returns a copy which has had the substitution applied to it. possibly a
> s/// modifier?
>
> $new = $old =~ s/foo/bar/n ;
>
> n for new?
if our internal string representation could grow from
> TC> ($this = $that) =~ s/foo/bar/;
> TC> for (@these = @those) { s/foo/bar/ }
> TC> You can't really do those in one step without it.
>but do they really need to be combined into one step? i sometimes prefer
>the separate assignment statement for clarity. other times i feel i am
>
>RFC 164 v2 has a new syntax that lets you do the above or, if you want:
> $this = s/foo/bar/, $that;
> @these = s/foo/bar/, @those;
>Consistent with split, join, splice, etc, etc.
That looks tremendously *IN*consistent, since now you must alter
the laws of precedence! :-(
% perl -MO=D
I keep noticing the connection between
$foo =~ /whatever/;
$foo->whatever;
for ($foo) { whatever }
They're all topicalizers.
--tom
Mike Lambert wrote:
>
> or even:
> @a = s/a+/a/, @a;
This is actually the native syntax from RFC 164.
> Basically, the argument is that you could theoretically do @a =~ s/a+/a/
> with QS, along with many other things. So perhaps, imo, it would be best
> to just let QS handle it.
I'm fine with t
On Wed, 30 Aug 2000, Nathan Wiger wrote:
> RFC 164 v2 has a new syntax that lets you do the above or, if you want:
>
>$this = s/foo/bar/, $that;
>@these = s/foo/bar/, @those;
>
> See RFC 164 v2, all this is supported, as well as this:
>
>@str =~ s/foo/bar/;
>
> Which has been a pi
Nathan Wiger wrote:
[...]
> RFC 164 v2 has a new syntax that lets you do the above or, if you want:
>
>$this = s/foo/bar/, $that;
>@these = s/foo/bar/, @those;
>
> Consistent with split, join, splice, etc, etc.
I often use the comma operator like this
s/foo/bar/, $n++ if $x;
If "s"
Uri Guttman wrote:
>
> TC> ($this = $that) =~ s/foo/bar/;
> TC> for (@these = @those) { s/foo/bar/ }
>
> TC> You can't really do those in one step without it.
RFC 164 v2 has a new syntax that lets you do the above or, if you want:
$this = s/foo/bar/, $that;
@these = s/foo/b
> "TC" == Tom Christiansen <[EMAIL PROTECTED]> writes:
>> who uses select directly anymore? use a module! :)
TC> I see the smiley, but one must be exceedingly careful not to
TC> enshrine one's own personal preferences and predilections--one's
TC> own small choices of style and nuance
10 matches
Mail list logo