sub main { print $cgi->header(-type => 'text/html'); if ($suchen) { if ($identnr =~m/^\d{6,9}[AB]?$/) { suchen() } elsif ($identnr =~ /^\d+\*$/) { $identnr =~ s/\*//g; suchen_wild() } } ............. elsif ($auswahl) { &suchen_doc(); } } sub suchen_wild { my $dbh = DBI->connect($DBN,$DBUSER,$DBPASS) or die $DBI::errstr; my $statement_suchen="SELECT * FROM $TABELLE where ident_nr like '$identnr%' order by docname"; my $sth_suchen=$dbh->prepare($statement_suchen) or die $DBI::errstr; $sth_suchen->execute; my @daten=(); my @order= qw/identnr langtyp doctyp docname head langtxt datum ersteller werk check1 check2 check3 check4/; while (my @row = $sth_suchen->fetchrow_array()) { my %hash; for (my $i=0; $i < scalar @order; $i++) { $hash{$order[$i]} = $row[$i]; } push @daten, \%hash; } &wild_vorhanden(\@daten); $sth_suchen->finish(); $dbh->disconnect(); } sub wild_vorhanden { my ($daten) = @_; print "\n"; print "FORMULAR\n"; print ""; print '
LIDOS Zusatzinformation
'; print '
'; print "

Ident-Nummer:"; print ' '; print ''; print '

'; print ''; foreach my $ptr (@{$daten}) { print qq~~; } print '
Identnummer doc_typ doc_name  
$ptr->{identnr} $ptr->{doctyp} $ptr->{docname} Auswählen
'; print '

'; print "

"; } sub suchen_doc { my $dbh = DBI->connect($DBN,$DBUSER,$DBPASS) or die $DBI::errstr; my $statement_suchen="SELECT * FROM $TABELLE where ident_nr='$identnr' and docname = '$docname'"; my $sth_suchen=$dbh->prepare($statement_suchen) or die $DBI::errstr; $sth_suchen->execute; my %hash; while (my @row = $sth_suchen->fetchrow_array()) { $hash{head_de} = $row[4] if ($row[1] eq 'DE'); $hash{head_en} = $row[4] if ($row[1] eq 'EN'); $hash{head_fr} = $row[4] if ($row[1] eq 'FR'); $hash{deutsch} = $row[5] if ($row[1] eq 'DE'); $hash{englisch} = $row[5] if ($row[1] eq 'EN'); $hash{franz} = $row[5] if ($row[1] eq 'FR'); $hash{date} = $row[6]; } &test(%hash); $sth_suchen->finish(); $dbh->disconnect(); } sub test { my (%param) = @_; my $param = \%param; print qq~ check1: $check1 check2: $check2 check3: $check3 check4: $check4 head_de: $param->{head_de} head_en: $param->{head_en} identnr: $identnr docname: $docname ersteller: $ersteller $werk $doctyp ~; }