jeteve has asked for the wisdom of the Perl Monks concerning the following question:

Hi All. I am using XML::SAX api for parsing an XML file. My handler constructs some datastructure based on what is read. I'd like it to return data via the call to parse('myfile.xml') instead of copying this data elsewhere for later access. To be short, i'd like to do:
my $handler = MY:Handler->new(); $parser->handler($handler); my $struct = $parser->parse('myfile.xml');
Is it possible ? Thanks for help !

Replies are listed 'Best First'.
Re: what does XML::SAX parse method return ?
by gellyfish (Monsignor) on Apr 21, 2005 at 14:15 UTC

    The parse method returns whatever value your end_document handler returns. See the Perl Sax documentation for more on this

    /J\