my $file = "meinedatei.txt"; # Die zu lesende Datei my (@ioc, @kb, @sdc); # 3 Arrays für 3 Datentypen open(FH,"<$file") || die $!; # Datei $file öffnen while(){ # Schleife chomp; push @ioc, $_ if($_ =~ /^psaf/); # Wenn Zeile mit psaf anfängt, rein ins @ioc. $_ ist eine vordefinierte Varialble push @kb, $_ if($_ =~ /^psrs/); # Wie oben push @sdc, $_ if(_ =~ /^pssd/); # Wie oben close(FH); print "Content-type: text/html\n\n"; print "\n"; print "\n"; print "\n"; foreach(@ioc){ print "\n"; print "\n"; print "\n"; } foreach(@ikb){ print "\n"; print "\n"; print "\n"; } foreach(@sdc){ print "\n"; print "\n"; print "\n"; } print "
$_
$_
$_
\n"; print "\n"; print "\n";