Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 lurking in the Monastery: (5)
As of 2014-12-18 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (41 votes), past polls