Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: The Regex Approach: Merging 2 strings like a zip

by Anonymous Monk
on Jul 11, 2015 at 18:43 UTC ( [id://1134307]=note: print w/replies, xml ) Need Help??


in reply to The Regex Approach: Merging 2 strings like a zip
in thread Merge 2 strings like a zip

You'll need a // operator there, otherwise it eats the 0's in $b...

An alternative:

$b = reverse $b; $a =~ s{.\K}{chop $b}sge; print $a;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-04-23 10:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found