in reply to Need help with badwords routine
Note that you are calling error with the bareword bad_words, not the variable $badwords. (Yet another of many reasons to use strict; use warnings—but many people have pointed out that this looks Perl 4-ish, and I guess that these pragmata weren't available then.) Thus, your error subroutine is always called.&error(bad_words) if ($badword_found == 1);
UPDATE: Immediately after posting, I saw that I'd completely ignored the trailing if ..., so your error routine need not always be called after all. Still, you probably don't want to call it this way.
|
|---|