In an expression like
$filename = "C:\\core\\jobs_1.xml" you only use the double backslashes to
escape a single backslash.
Here $var really contains
C:\core\jobs_1.xml.
But your $filename contains the double backslashes (as shown by the
print statement), and that could be the reason for your problem.