Another way to write it:
unless ($input =~ /badinput/) { print $input; }
Or even
print $input unless $input =~ /badinput/;
With perl 5.10 or newer you can also write
use 5.010; given ($input) { print unless /badinput/; }
Though usually it is a better idea to check for valid input (whitelisting) than checking for bad input (blacklisting).
In reply to Re: totally lost
by moritz
in thread totally lost
by sweepy838
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |