loris has asked for the wisdom of the Perl Monks concerning the following question:
I want to do something like:
my $node = $self->makeMyNode('Blorp') $self->addMyNode($node); ... sub addMyNode { my ($self,$node) = @_; my $parentNode = $self->generateParentNode($node); $parentNode->addChild($node); }
but I get the error
XML::LibXML::Node::addChild() -- nNode is not a blessed SV reference a +t ...
I assume I must do bless at some point, but I am not clear how. Should I be passing a reference and then blessing that?
Thanks,
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Unblessed problem when passing structures as agrument
by dragonchild (Archbishop) on Oct 27, 2005 at 13:38 UTC | |
by loris (Hermit) on Oct 28, 2005 at 07:27 UTC |