#!/usr/bin/perl -wT use strict; use CGI qw/:standard/; # use this where you would ordinarily have # print "Content-Type: text/html\n\n"; print header( -target => 'stuff' ); my $_patent = param( 'patent' ); # see 'perldoc perlsec' # $patent is set to digits or zero my ( $patent ) = ( $_patent =~ /^(\d+)$/ ) || 0; if ( $patent < 1 or $patent > 6000555 ) { send_error_page(); } else { # patent number is good, let's process it } sub send_error_page { print < Data Entry Error
Patent number must be a number between 1 and 6000555, inclusive.
Use your browser's BACK option to try again.

ENDERRORCARD }