#!/usr/bin/perl $filename2 = "/usr/local/etc/httpd/htdocs/dancewithdebbie/email.txt"; $filename = "/var/mail/debbienl"; $redirect = "http://www.dcdancenet.com/dancewithdebbie/news2.shtml"; open(FILE,"$filename"); @lines = ; close(FILE); $start=0;$finish=0; open(WRITE,">$filename2") || die "Can't open $filename2!\n"; foreach (@lines) { chomp; #now you can ignore the \n if ($_ eq "Dance with Debbie") { $start=1; } if ($_ eq "Content-Type: text/html;") { last; } if ($start ==1) { print WRITE "$_\n"; #add it back in } } close (WRITE); print "Location: $redirect\n\n";