Using Data::Dumper to serialize the structure of a tree of XML document : Data « System Functions « Perl






Using Data::Dumper to serialize the structure of a tree of XML document

   



use XML::Parser;

$parser = new XML::Parser( Style => 'Tree' );
my $tree = $parser->parsefile( shift @ARGV );

# serialize the structure
use Data::Dumper;
print Dumper( $tree );

   
    
    
  








Related examples in the same category

1.use Data::Dumper;
2.Using Data::Dumper to print the results of tree-based parsing
3.Pass new variable name to Data::Dumper function
4.Use the Data:: Dumper function to output complex value
5.use Data Dumper to dump the reference