#!/usr/bin/perl -wT use strict "vars"; use CGI qw(:standard); use CGI::Carp qw(fatalsToBrowser); use DBI; my $query = new CGI; # the four variables from the form: my $email = $query->param('email'); my $CodeIntern = $query->param('CodeIntern'); my $AnzDru = $query->param('AnzDru'); my $Aufla = $query->param('Aufla'); # the global variables are: use vars qw($say $now $data $res); # if NO email-address is given: if (! $email) { $say = "Tja, ohne E-Mail geht's nicht..."; $now = "...probier's nochmal!"; &error_page; } # if a wrong email-address is given: elsif ($email !~ /^[\w-.]+\@[\w-.]+$/) { $say = "Mit der E-Mail ist irgendwas faul..."; $now = "...schau' sie Dir nochmal an!"; &error_page; } # if one of the three choose-points remains empty: elsif (!$CodeIntern or !$AnzDru or !$Aufla) { $say = "Du hast nix angetippt..."; $now = "...probier's nochmal!"; &error_page; } # if everything seems ok: else { &get_price; &show_result; } sub error_page { print $query->header; print <<"EOM"