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


in reply to Golf: Embedded In Order

42 chars in the sub.
use strict; my $s = "abcdefghijklmnopqrstuvwxyz"; my $t = "for"; print x($s,$t),"\n"; $t="perl"; print x($s,$t),"\n"; sub x{ my($s,$t)=@_; eval"\$s=~tr/$t//cd"; $s eq$t; }
update
one less:
sub x{ eval"\$_[0]=~tr/$_[1]//cd";$_[0]eq$_[1]; }