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;
}
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;
}