in reply to CGI form validation on submit

Me? I wouldn't put a Perl sub in a CGI form ... i would put a CGI form in a Perl script:
#!/usr/bin/perl -T use strict; use warnings; use CGI qw(:standard); # print form print header, start_html('test for blank vals'), start_form(-method=>'POST'), 'Enter something (or not) ', textfield('value'), submit, end_form, hr, ; # get val from query - empty string as default my $value = param('value'); # remove leading and trailing space $value =~ s/^\s+//; $value =~ s/\s+$//; # have to be careful ... the empty string is defined # and zero is false, so let's check the length instead if (length($value)) { print p("You entered '$value' - thanks. :)"); } else { print p('No value entered, please try again'); }

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)