drmikec has asked for the wisdom of the Perl Monks concerning the following question:
Here is the offending section, it breaks with the first flush():"Can't call method "flush" on an undefined value at C:/Perl/site/lib/X +ML/Twig.pm line 6832, <INFILE> line 4083."
I want to use WxPerl to put a nice Windows wrapper around it, so I need the 5.8.x. Any help or insight would be greatly appreciated! -Mikeselect \*OUTFILE; my $t = new XML::Twig( twig_roots => { # 'MemberID' => \&member, 'Aging' => \&balance, 'Transaction' => \&transaction +, 'Line' => \&line, 'Chits' => \&chits}, pretty_print => 'indented', twig_print_outside_roots => \*OUTFILE, + # print the rest ); $t -> parsefile ("temp.xml"); <snip> sub balance { my ($t, $balance) = @_ ; my %balance; $balance{30} = $balance->field( 'BAL_30' ); $balance{60} = $balance->field( 'BAL_60' ); $balance{90} = $balance->field( 'BAL_90' ); $balance{120} = $balance->field( 'BAL_120' ); $balance{150} = $balance->field( 'BAL_150' ); $balance{180} = $balance->field( 'BAL_180' ); local ($balance90, $balance120, $balance150, $balance180); $balance30 = $balance{30}; $balance60 = $balance{60}; $balance90 = $balance{90}; $balance120 = $balance{120}; $balance150 = $balance{150}; $balance180 = $balance{180}; local $balancelate = ($balance90 + $balance120 + $balance150 + $ba +lance180); $balancelate =$rounder->round($balancelate); $balance->delete(90); $balance->delete(120); $balance->delete(150); $balance->delete(180); my $balance30elt = new XML::Twig::Elt('BAL_30', $balance30); $balance30elt->set_text($balance30); $balance30elt->set_att(Period => 1); $balance30elt->paste('first_child', $balance); my $balance60elt = new XML::Twig::Elt('BAL_60', $balance60); $balance60elt->set_text($balance60); $balance60elt->set_att(Period => 2); $balance60elt->paste('last_child', $balance); my $balance90 = new XML::Twig::Elt('BAL_90', "$balancelate"); $balance90->set_text( "$balancelate" ); $balance90->set_att(Period => 3); $balance90->paste('last_child', $balance); $balance -> flush(\*OUTFILE); }
Edited by planetscape - removed pre tags, replaced with code tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML-Twig - AS5.6.1 vs AS 5.8.8
by runrig (Abbot) on Mar 29, 2006 at 00:34 UTC | |
|
Re: XML-Twig - AS5.6.1 vs AS 5.8.8
by mirod (Canon) on Mar 29, 2006 at 08:09 UTC | |
by drmikec (Initiate) on Mar 29, 2006 at 21:00 UTC | |
by runrig (Abbot) on Mar 29, 2006 at 22:13 UTC | |
by drmikec (Initiate) on Mar 29, 2006 at 22:39 UTC | |
by runrig (Abbot) on Mar 30, 2006 at 21:37 UTC |