in reply to Is a file XML?

Open up the file and look for the declaration line.

$isxml = 0; while(<HANDLE>) { if($_ =~ /.*xml\s+version/i) { $isxml = 1; last; } } if($isxml) { # xml file stuff here } else { # not xml file stuff here }

This was written in a hurry and not tested (I need to run to a meeting ;)) but it should be enough to start with

Update: Rereading this post-meeting I see I missed the question altogether.... davorg gave the right answer ;)

$japh->{'Caillte'} = $me;

Replies are listed 'Best First'.
Re: Re: Is a file XML?
by davorg (Chancellor) on Sep 25, 2001 at 15:34 UTC

    Just because a file has a XML declaration on the first line doesn't mean that it's a well-formed XML file.

    --
    <http://www.dave.org.uk>

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