< Parsing a string >

To parse a string use the parse method instead of parsefile.


use strict;
use XML::Parser;

my $xml = '<xml/>';

my $parser = new XML::Parser();

$parser->parse($xml);