in reply to unblessed reference
Whatever is in your array, @$root, are not objects at all, so they can't dispatch method calls. They're merely references. In Perl an object is a blessed reference, hence the error message, "can't call method '...' on unblessed reference". You can get better explanations of errors like this if you put use diagnostics at the top of your program.
To have a look at what those references actually are, use Data::Dumper or some other method listed in How can I visualize my complex data structure?
|
|---|