in reply to Re^5: regex syntax and idomatic Perl
in thread regex syntax and idomatic Perl

Yes, except for a precedence problem:

c:\@Work\Perl\monks>perl -wMstrict -le "my $x = 'abcdefghi'; substr($x, 5, 3) =~ s/g/G/; print $x; " abcdefGhi
Without some sort of scoping disambiguation, the s/g/G/ binds to 3 in
    substr $x,5,3 =~ s/g/G/;


Give a man a fish:  <%-{-{-{-<

Replies are listed 'Best First'.
Re^7: regex syntax and idomatic Perl
by cbeckley (Curate) on Mar 23, 2017 at 02:05 UTC

    Ah, yes, I suspected that might be the case.
    Didn't have access to a command prompt, alas.