Often it's best to fail if a match succeeds. In your example, you try to verify that data is all word characters. The test, $string =~ /\W/ will be false only if $string is all word characters. That is a much simpler approach, testing for what you won't accept.
After Compline,
Zaxo
In reply to Re: Code Cleanup challenge!
by Zaxo
in thread Code Cleanup challenge!
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |