I've tried this every which way but loose. I made this progam:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html>\n\n";
opendir (DOPPLER, "/home/gennus/gennus-www/wfmy/doppler/");
@filenames = grep (!/^capture/ && /-/, readdir (DOPPLER));
closedir (DOPPLER);
@filenames = sort { $a <=> $b } @filenames;
unlink "/home/gennus/gennus-www/wfmy/doppler/$filenames[0]";
exit;
What it does is opens the directory, sorts the files from oldest to newest and deletes the oldest. This all works fine from my browser. BUT, I have a program that runs it every five minutes from a remote machine by calling the URL. Much like a browser, I would think. Anyway, when I run it from this program, evidently it sorts them wrong because it deletes the newest one.
Help!
------------------
WFMY-TV Webmaster
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html>\n\n";
opendir (DOPPLER, "/home/gennus/gennus-www/wfmy/doppler/");
@filenames = grep (!/^capture/ && /-/, readdir (DOPPLER));
closedir (DOPPLER);
@filenames = sort { $a <=> $b } @filenames;
unlink "/home/gennus/gennus-www/wfmy/doppler/$filenames[0]";
exit;
What it does is opens the directory, sorts the files from oldest to newest and deletes the oldest. This all works fine from my browser. BUT, I have a program that runs it every five minutes from a remote machine by calling the URL. Much like a browser, I would think. Anyway, when I run it from this program, evidently it sorts them wrong because it deletes the newest one.
Help!
------------------
WFMY-TV Webmaster

