Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^6: regex syntax and idomatic Perl

by AnomalousMonk (Archbishop)
on Mar 23, 2017 at 01:43 UTC ( [id://1185526]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1185526]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (4)
As of 2024-04-25 17:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found