http://www.perlmonks.org?node_id=77223


in reply to (golf) Interlaced Strings

Answers of varying lengths:
sub interlace { # 52 my$x=pop;my$y=reverse+pop;$x=~s/./chop($y).$&/esg;$x } sub interlace { # 47 my$x=pop;@_=split//,pop;$x=~s/./shift.$&/esg;$x } sub interlace { # 45 ($_,@_)=(pop,split//,pop);s/./shift.$&/esg;$_ }
The last two suffer a mandatory 'shift without parens' warning.

Update: here's a shorter one, without said warning.

sub interlace { # 43 $_=shift;@_=split//,pop;s/./$&.shift/esg;$_ }


japhy -- Perl and Regex Hacker