Yes the files are readable and have been given full permission (777). The exact string passed is "/opt/xmls/filename.xml"
The same set of code is already working in different servers, this one is being newly built and all the perl modules have been added , but this is where it is getting stuck. Is it possible due to Linux version, it might be a problem ? The new one/not working ones are on Red Hat Enterprise Linux Server release 7.8 (Maipo) and the old ones/working ones are on Red Hat Enterprise Linux Server release 6.7 (Santiago).