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

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hello
in the following code which will remove 'b', 'z', 'y' from the string i can't simplify the:
($1 eq 'b' | $1 eq 'z' | $1 eq 'y') to a more concise one
any suggestions, thanks
#!/usr/bin/perl use warnings; use strict; my $str = "abc xxxssyy zx"; $str =~ s/(.)/($1 eq 'b' | $1 eq 'z' | $1 eq 'y')? "" : $1/egs; print $str;