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


in reply to Golf: Embedded In Order


Yet Another Attempt. Hefty though, weighs in at 110 characters, is strict and warnings compliant and solves extra credit though...
sub x{ my($s,$t,$p)=(@_,0); (join'',map{$s=~/$_/g?($p<pos$s?($p=pos$s and$s=~s/$_//and$_):''):' +'}split//,$t)eq$t?$s:undef }
i'd be delighted to see someone trim it down...

nuf evah,
jynx