Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: XML::Twig output problem

by plockhart (Initiate)
on Jan 06, 2012 at 19:58 UTC ( #946658=note: print w/replies, xml ) Need Help??


in reply to 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!

Replies are listed 'Best First'.
Re^2: XML::Twig output problem
by Anonymous Monk on Jan 07, 2012 at 08:25 UTC

    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?

      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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946658]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2016-10-01 18:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (3 votes). Check out past polls.