No specific answer, but you might try adding print statements to confirm that your variables are getting set with the values you expect, that your SQL statement looks right, etc...
One thing that seems odd is the comma after the date in this line:#my @remove_dates = ("2002-04-21,");
(I realized it's commented out, just not sure why it would be there in the first place.)
Comment on Re: Failing when called by another script