in reply to (jeffa) Re: Pattern Matching
in thread Pattern Matching
I would yellow-flag that in a code review, since the comment does not precisely match the action, and needlessly. Some maintenance programmer is going to wonder "Why does he call a dash an underscore?".$report =~ tr/-_.//d; # underscores, dashes, and periods
I might also add a comment to explain why it's not
which would invoke the range-ness of the dash. Or maybe I'd change it to:tr/_-.//d
to make it clear that the dash doesn't have its dashing nature.tr/\-_.//d
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|