Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: XML::Twig and closures.

by mirod (Canon)
on Dec 14, 2007 at 08:33 UTC ( [id://657005]=note: print w/replies, xml ) Need Help??


in reply to XML::Twig and closures.

I am not quite sure what you want to do here, but did you know that you "friend" (joking ;--) can generate a closure "on the fly"?

It goes simply like this:

my $self={}; XML::Twig->new( twig_handlers => { 'a/b' => sub { $self->my_method( @_ +); } ); ... sub my_method { my( $self, $t, $elt)= @_; ... }

Simon Cozens' Achieving Closure article has more details on closures, using XML::Twig as an example.

Does that help?

Replies are listed 'Best First'.
Re^2: XML::Twig and closures.
by absolut.todd (Monk) on Dec 17, 2007 at 01:22 UTC
    Ahhhhh, and the lightbulb turns on! Thank you, that is exactly what i was trying to achieve for my "friend".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://657005]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-19 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found