Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Is a file XML?

by davorg (Chancellor)
on Sep 25, 2001 at 15:23 UTC ( #114507=note: print w/ replies, xml ) Need Help??


in reply to Is a file XML?

That's pretty much how I'd do it. Using code like this:

use XML::Parser; my $p = XML::Parser->new; my $file = 'whatever.xml'; eval { $p->parsefile($file) }; if ($@) { # XML is not well formed } else { # XML is well formed }
--
<http://www.dave.org.uk>

"The first rule of Perl club is you don't talk about Perl club."


Comment on Re: Is a file XML?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2015-07-01 21:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (22 votes), past polls