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

Re^5: s///g within m//g regions

by hippo (Bishop)
on Nov 09, 2021 at 13:50 UTC ( #11138616=note: print w/replies, xml ) Need Help??


in reply to Re^4: s///g within m//g regions
in thread s///g within m//g regions

use strict; use warnings; use feature 'state'; use Test::More tests => 1; my $in = 'A |simple*example| is |so*simple| to come*up |with these*days|'; my $want = 'A |simple-example| is |so-simple| to come*up |with these-days|'; my $have = join '|', map { state $i = 0; $i++ % 2 and s/\*/-/g; $_ } split /\|/, $in, -1; is $have, $want;

🦛

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2022-05-29 06:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (101 votes). Check out past polls.

    Notices?