Directories in on specific case were not updated or created. The bug came from the origin of the source directory. copy("$MY_HOME_DIR/$fnc","$dir/$fnc") or die(getcwd() . " error $!"); replaced by copy("$fnc","$dir/$fnc") or die(getcwd() . " error $!");