XML::Twig -- help with something small

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


In my perl application, I need to create a lot of twigs, I wanted a way
to quickly create a twig by just passing a subroute Node, Function and
File to parse.  I created this, the problem is the Function that is
called ($temp[1]), Perl believe it is a bareword and halts.  Is there
anyway to "cast" it so Perl knows it is a subroutine?

Thanks a lot,

Rishi D

use XML::Twig;
use strict;

quickTwig("DBMS", "getXMLDBInfo", "tmp/$inputHash/DBList.xml");
sub quickTwig {
    # @temp = [Node, Function, File]
    my @temp = @_;
    my $twig = XML::Twig->new(twig_handlers => { $temp[0] => $temp[1] });

Site Timeline