You know, on second thought, I don't think there's a problem at all, except that you do need to use a 4- or 5-digit ID number.
The line
if ($file =~ /^$rec{'ID'}/) {
just looks to see if the filename begins with the same characters as the value of $rec{'ID'}. It doesn't matter how many characters there are.
The line
$delete_list{$data[$db_key_pos]} = 0;
just is a flag to keep track of the records that have been deleted.
Yes, you are correct that, if you delete all files that are named 1*, you will delete 12*, 105*, 10746*, etc.
------------------
JPD
The line
if ($file =~ /^$rec{'ID'}/) {
just looks to see if the filename begins with the same characters as the value of $rec{'ID'}. It doesn't matter how many characters there are.
The line
$delete_list{$data[$db_key_pos]} = 0;
just is a flag to keep track of the records that have been deleted.
Yes, you are correct that, if you delete all files that are named 1*, you will delete 12*, 105*, 10746*, etc.
------------------
JPD