you could use a file test operator to check that files exist before they are overwritten. Type
perldoc perlfunc at a command prompt and look in the section "Alphabetical List of Perl Functions" to see the full list of file test operators.
print "Save data to what file?";
$filename=<STDIN>; chomp $filename;
if (-s $filename){
warn "$file contents will be overwritten!\n";
warn "$filename was last updated ", -M $filename, "days ago.\n";
}
-M =returns the age (in days)
-s =returns the size of the data (in bytes)
Martmart