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

Re: What is wrong here (Replacing Strin pieces)

by AnomalousMonk (Monsignor)
on Jul 16, 2013 at 16:28 UTC ( #1044633=note: print w/ replies, xml ) Need Help??


in reply to What is wrong here (Replacing Strin pieces)

For production code, I think I prefer something like rjt's approach, but here's a cute variation:

>perl -wMstrict -le "my $s = '---------xxxxxxxxxxxxxxx------yyyyyyyyyyyyyy--------'; print qq{'$s'}; ;; $s =~ s{ (?: \G | (?= -+ \z)) - }'?'xmsg; print qq{'$s'}; " '---------xxxxxxxxxxxxxxx------yyyyyyyyyyyyyy--------' '?????????xxxxxxxxxxxxxxx------yyyyyyyyyyyyyy????????'


Comment on Re: What is wrong here (Replacing Strin pieces)
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2014-08-01 05:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (256 votes), past polls