in reply to Re^3: Code Issue after Upgrading the perl from 5.14.4 to 5.22.3
in thread Code Issue after Upgrading the perl from 5.14.4 to 5.22.3

Your next step is to inspect what is in %CONFIG_FILE when you encounter that condition.

Use the following code:

if ($file =~ /$key/) { $mapattach = $value; use Data::Dumper; print Dumper \%CONFIG_FILE; }

Also output whenever you get a match on /$key/:

if ($file =~ /$key/) { $mapattach = $value; use Data::Dumper; print Dumper \%CONFIG_FILE; print "'$file' matches /$key/, setting value '$value'\n"; }

Maybe there are two keys in %CONFIG_FILE that match the filename and the second one overwrites the first match in some cases? You are aware that hash keys are not ordered in Perl?