$_='A # B # 1 # 2'; print join ' # ', sub { map @_[$_,$_+@_/2], 0..$#_/2 }->( split / # / );