hackermike has asked for the wisdom of the Perl Monks concerning the following question:
#!/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 = <FILE>; 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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting the last desired block of text from a server eMail file
by bpphillips (Friar) on Sep 16, 2004 at 19:38 UTC | |
by hackermike (Novice) on Sep 17, 2004 at 05:46 UTC | |
|
Re: Extracting the last desired block of text from a server eMail file
by Anonymous Monk on Sep 17, 2004 at 23:27 UTC |