Naming multiple variables with the same name like you did ($args, %args) is a bad idea. because when you want to access the value of the hash %args ($args{FN}) you are accessing in reality what was shifted in the scalar $args and not the hash %args because perl use simbolic reference. here is a link that explain that
https://perlmaven.com/symbolic-reference-in-perl *Khalil Zakaria Zemmoura* *Visiteur Médical EST* *Laboratoire NOVOMEDIS*