$str =~ s/(?:\Q$chompstr\E)+\z//;
Wouldn't this also fail if $chompstr contained \E ?
Or use the quotemeta builtin.
This is nice! I had used this function a few years ago, but meanwhile forgotten it.
By the way you'd have to use chomp and not chop
Of course, you are right. I was too careless when sketching my solutions...
In reply to Re^2: Chomping Frenzy question
by rovf
in thread Chomping Frenzy question
by rovf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |