XML::Twig -- help with something small

Discussion in 'Perl Misc' started by rishid@gmail.com, Jun 7, 2005.

  1. Guest

    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;
    }
     
    , Jun 7, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sherman Willden
    Replies:
    4
    Views:
    652
    Sherman Willden
    Aug 8, 2003
  2. Sherman Willden
    Replies:
    1
    Views:
    136
    Sisyphus
    Jul 25, 2003
  3. Sherman Willden
    Replies:
    3
    Views:
    170
    Sherman Willden
    Aug 8, 2003
  4. Replies:
    1
    Views:
    84
    John Bokma
    Jun 7, 2005
  5. alwaysonnet

    Get XML content using XML::Twig

    alwaysonnet, Apr 21, 2010, in forum: Perl Misc
    Replies:
    19
    Views:
    199
    Klaus
    Apr 29, 2010
Loading...

Share This Page