XML::Twig -- help with something small

R

rishid

Hi,

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{'host'}/DBList.xml");
sub quickTwig {
# @temp = [Node, Function, File]
my @temp = @_;
my $twig = XML::Twig->new(twig_handlers => { $temp[0] => $temp[1] });
$twig->parsefile($temp[2]);
$twig->purge;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top