R
rishid
Hi,
I need to create about 100 twigs or so in my program I am writing and
wanted to create a quick method to just create twigs with one line. I
created this subfunction. So I can just call this function with a
single. The problem I am having is the function call ($temp[1]), Perl
thinks it is a bareword/string and not a function. Anyway to "cast" it
to a sub routine?
Thanks,
Rishi Dhupar
use strict;
use XML::Twig;
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;
}
I need to create about 100 twigs or so in my program I am writing and
wanted to create a quick method to just create twigs with one line. I
created this subfunction. So I can just call this function with a
single. The problem I am having is the function call ($temp[1]), Perl
thinks it is a bareword/string and not a function. Anyway to "cast" it
to a sub routine?
Thanks,
Rishi Dhupar
use strict;
use XML::Twig;
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;
}