http://qs1969.pair.com?node_id=601027


in reply to Re^2: Print out an XML file to browser
in thread Print out an XML file to browser

Please make sure whether you have "master.xml" in the specified location.
Use the below code.
open(XMLFILE, "/my/upload/path/master.xml") or die("Can't open file m +aster.xml : $!");
also its best practice to close the filehandle after the usage.
close(XMLFILE)

Replies are listed 'Best First'.
Re^4: Print out an XML file to browser
by virtualsue (Vicar) on Feb 20, 2007 at 06:26 UTC
    It isn't really necessary to bother about closing a read-only filehandle. If you want to be rigorous and check everything, then why aren't you checking whether the print statements succeed? :) If you were writing to the file, then I agree - close the filehandle and check to see if an error occurred.
Re^4: Print out an XML file to browser
by lakeTrout (Scribe) on Feb 20, 2007 at 05:55 UTC
    how does the <while> look?