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

use IPC::Open3;open3*0,*1,*2,$^X,"-we$&$1=>"and$_.=0,<2>||$_++while Idiigdigdsgisdigggss0001issigdigidsdi =~/.(?=(.))/g;print pack'b*',$_;