Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # Upload Alert Script opendir(DIR,'../'); @dir = readdir(DIR); closedir(DIR); $files = 0; foreach $i (0..$#dir) { if( ($dir[$i] ne "index.html") && ($dir[$i] ne ".") && ($dir[$i] ne "..") && ($dir[$i] ne "cgi-bin") ) {$files = 1} } if($files == 1) { open(MAIL,"|/usr/sbin/sendmail -t"); print MAIL <<"EOC"; To: admin\@thiswebsite.com From: notify\@thiswebsite.com Reply-to: admin\@thiswebsite.com Subject: !!! Newly Uploaded Files !!! New files uploaded. . EOC close(MAIL); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: STUPID STUPID STUPID old me.
by grantm (Parson) on Oct 28, 2002 at 09:17 UTC | |
by BrentDax (Hermit) on Oct 30, 2002 at 03:10 UTC | |
Re: STUPID STUPID STUPID old me.
by Chady (Priest) on Oct 28, 2002 at 08:09 UTC | |
Re: STUPID STUPID STUPID old me.
by George_Sherston (Vicar) on Oct 28, 2002 at 11:57 UTC | |
Re: STUPID STUPID STUPID old me.
by bart (Canon) on Oct 28, 2002 at 12:27 UTC | |
Re: STUPID STUPID STUPID old me.
by Louis_Wu (Chaplain) on Oct 28, 2002 at 07:43 UTC | |
by Anonymous Monk on Oct 28, 2002 at 07:49 UTC | |
by Ananda (Pilgrim) on Oct 28, 2002 at 08:36 UTC | |
by Louis_Wu (Chaplain) on Oct 28, 2002 at 08:41 UTC |