Hello folks!

Do you know XML::easytree? It's really good tool, but unfortunately I am a perl newbie and I can't get the content of the $tree out for my other purposes. I am really depressed, for last 4 days I couldn't come up with my own idea and the only example of what I want to do next I found is some kind of broken or what.


#!/usr/bin/perl -w 
use strict; 
use warnings;
use XML::Parser; 
use XML::Parser::EasyTree; 
use Data::Dumper;
my $p=new XML::Parser(Style=>'EasyTree'); 
my $tree=$p->parsefile("test.xml"); 

sub print_easy_tree 
    my $node = shift; 

        if ($node->{type} eq 'e') 
            print "<$node->{name}>"; 
            print "</$node->{name}>"; 
        elsif ($node->{type} eq 't') 
            print $node->{content}; 
            print "[IGNORED $node->{type}]"; 
When I try to execute this code, there is an error Not a HASH reference in line where is if ($node->{type} eq 'e'). I know that first it is an ARRAY, but how should I repair it? Something with ref()?