Hi,
I'm trying to write a program that will delete old mail off the server. Here 
is what I have so far:

#!/usr/bin/perl -w

sub readdata {

open (MAIL, "/home/test17/test17-mail/test17") || die "Cannot open ssh17: 
$!";
my(@ML)=<MAIL>;
chomp @ML;
close(MAIL);
return(@ML);
}

sub writedata {
my (@ML)=@_; #Accept changes
open(MAIL, ">/home/test17/test17-mail/test17") || die "Cannot open ssh17: 
$!";
foreach (@ML) {
        print MAIL "$_\n";
        }
   close (MAIL);
}




@DELMAIL=readdata();
#Remove the old mail
#I'm having trouble with this section right here.
#I can grep out specific dates, but I'm trying
#to delete everything from 1 date till the next
#date is found. Any help would be great.
@DELMAIL=grep(/Oct/, @DELMAIL);
@DELMAIL=grep(! /Aug/, @DELMAIL);
writedata(@DELMAIL);

Sincerely,
Matthew

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to