in reply to Compare dates help!

I guess your problem is that the comparision does not work for you in the following line:

if($file <= $exp_dir_date){...
Your dates (e.g. $exp_dir_date or the filenames) are strings, therefore you should use the string compare operators instead of <=, = ... . In your case le would be the correct one.

HTH, Rata