#! /usr/bin/perl use strict; use diagnostics; use CGI; use CGI::Carp qw(fatalsToBrowser); my $cgi = CGI->new(); my %params = $cgi->Vars(); print $cgi->header(-type => 'text/html'); my $string = $params{Vorname}.'|'.$params{Nachname}.'|'.$params{Strasse}.'|'.$params{Nr}.'|'.$params{PLZ}.'|'.$params{Ort}.'|'.$params{Tel}.'|'.$params{EMail}."\n"; my $file = './data.txt'; open(R_FILE,"<$file") or die($!); my @entries = ; close R_FILE; foreach(@entries){ if($_ eq $string){ $_ = ""; } } open(W_TXT,">$file") or die($!); print $_ for(@entries); close W_TXT; print "Der Eintrag ".chomp($string)." wurde gelöscht";