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


in reply to Benchmarking "Are all these characters in this sentence?"

Just for completeness, try this one, too:
martin => sub { # args: sentence, wantedchars '' eq $_[1] || '' ne $_[0] && $_[1] =~ /^[\Q$_[0]\E]*\z/; },
Putting the whole sentence into a character class will kind of suck with veeery long sentences but medium-sized cases should benefit from the one-pass approach.

Update: fixed the order of subroutine parameters