<?xml version="1.0" encoding="windows-1252"?>
<node id="901332" title="Passing parameters for XML::twig handler" created="2011-04-26 08:08:29" updated="2011-04-26 08:08:29">
<type id="115">
perlquestion</type>
<author id="831137">
shree</author>
<data>
<field name="doctext">
I have a Perl program to parse the xml file, 
Here I have declared the final arrayref $ups_able_info as global.

Instead of this I want to make it local to the sub parsexml() and pass the same to the twig handle 'parse_table_info'. 

If I try to pass the arryref to the twig handle getting the ERROR: 'Global symbol "$ups_table_info" requires explicit package'.

Can any one help me on this
&lt;code&gt;
my ($ups_able_info) = ([]);

&amp;parseXml($xmlfile);

sub parseXml{
my $twig1 = new XML::Twig( twig_handlers =&gt; { 'ups:TABLE_INFO/ups:field' =&gt; \&amp;parse_table_info} );
}
### twig handler to parse columns.
sub parse_table_info {

        my( $twig, $table_info)= @_;
        my $table_column = {};

        $table_column-&gt;{$table_info-&gt;first_child_text('ups:tag')}  = $table_info-&gt;first_child_text('ups:ui_name');
        push(@{$ups_table_info}, $table_column);

}
&lt;/code&gt;</field>
</data>
</node>
