in reply to How to get content of an XML::easytree output
G'day Tworec,
Welcome to the monastery.
Firstly, I see you've commented out "use strict;" - uncomment this and also add "use warnings;". Removing the output of warnings does not remove the problem they're telling you about!
You've commented out the declaration "my $element;". You assign nothing to $element. You then use $element as if it's a hashref - this is why you're getting the error message you report.
Your print_easy_tree() subroutine assigns its argument to $node; you then make no further reference to $node! Each instance of $element in this function should probably be $node.
I believe that should fix up your immediate problems. Here's some tips that you may find generally useful (i.e. not just for this code); the first two won't necessarily change how your code runs, but they should make it easier to read and understand:
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to get content of an XML::easytree output
by tobyink (Canon) on Mar 08, 2013 at 06:44 UTC | |
by kcott (Archbishop) on Mar 08, 2013 at 08:22 UTC | |
|
Re^2: How to get content of an XML::easytree output
by Tworec (Initiate) on Mar 08, 2013 at 08:52 UTC | |
by kcott (Archbishop) on Mar 08, 2013 at 09:07 UTC | |
by Tworec (Initiate) on Mar 08, 2013 at 09:39 UTC | |
by kcott (Archbishop) on Mar 08, 2013 at 12:22 UTC |