Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Merge 2 strings like a zip

by Anonymous Monk
on Jul 09, 2015 at 22:32 UTC ( [id://1134052]=note: print w/replies, xml ) Need Help??


in reply to Merge 2 strings like a zip

hehehe

#!/usr/bin/perl # http://perlmonks.org/?node_id=1133857 use warnings; use strict; print zip("ABCDEFGHIJ", "abcde"), "\n"; sub zip { my ($str1, $str2) = @_; my $len = length $str2; pack("(ax)$len (a)*", split //, $str1) | pack "(xa)$len", split //, +$str2 }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-03-29 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found