Hi
you could even look into something as simple as:
get absolute path of filename input
use the stat command and slice the array subscript containg the file creation date.
ctime File creation time (C lang. time_t value)
then you could just remove all leading and trailing spaces from the date input and that received from stat.
and do a
if( $date =~ m/$date1/)
{ unlink file; }
HTH