Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: Print out an XML file to browser

by siva kumar (Pilgrim)
on Feb 20, 2007 at 05:41 UTC ( #601027=note: print w/replies, xml ) Need Help??


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?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://601027]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2022-12-01 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?