if (($in{'pic'} =~ /^[a-z0-9-_]+\.jpg$/i) && ($in{'cat'} =~ /^[1-7]$/)) { &showPic($in{'pic'}, $in{'cat'}); } elsif ($in{'cat'} =~ /^[1-7]$/) { &showCat($in{'cat'}); } else { &showError; }