in reply to Re: XML::Twig output problem
in thread XML::Twig output problem

I found a fix, though I am not understanding why it worked. I am new to both Perl and XML::Twig, so it should be no surprise. I updated the code to reflect the fix. If someone could explain what I am missing, I would certainly appreciate it!

Um, what did you update, where?

Replies are listed 'Best First'.
Re^3: XML::Twig output problem
by plockhart (Initiate) on Jan 12, 2012 at 02:10 UTC

    I updated the code that I was having trouble with, in particular:

    sub DumpOldAds { my ($twig,$nisNISJob)=@_; my $date = UnixDate("today", "%Y-%m-%d".'T00:00:00'); chomp $date; my $adate = $nisNISJob->findvalue('.//JobActiveDate'); print "\n$adate -|- $date\n"; if( $adate ne $date) { $nisNISJob->delete; } else { print $nisNISJob; }; }

    When I replaced "else {$twig->flush} with else {print $nisNISJob), it worked. What am I missing concerning flush not working? Thanks, P