http://qs1969.pair.com?node_id=788422


in reply to un-Nifty qr OR ASCII bullet parser

Safer (allows "-", for example):
my $bullet = sprintf qr/[%s]/, quotemeta join '', keys %bullets;
Alternative (shorter and returns a compiled regexp unlike the OP's and the above solutions):
my ($bullet) = map qr/[\Q$_\E]/, join '', keys %bullets;