Hi,
Look at the output of the following command :
ps -ef --cols 300 | grep myfilename
returns
username 23115 22308 6 15:24 ? 00:00:14 ftpd: myclient.machine: ftpusername: STOR myfilename
username 23153 22839 0 15:30 pts/1 00:00:00 grep myfilename
This was while downloading the file "myfilename".
So this command returns at least two lines. If the file is currently downloading, you may find one of the lines matching the pattern "STOR".
So what you have to do in your perl script is to set your grep command :
$filename = "myfilename";
$command = "ps -ef --cols 300 | grep $filename" ;
You have to catch the results of this command in an array :
@results = `$command`;
You have to see if one of these lines matches the "STOR" string :
foreach $line (@results) {
if ($line~=/STOR/) {print "Still downloading $filename \n";}
}
All what remains is to write a script with nice loops & checks

Hope this help