in reply to Re: XML::Twig output problem
in thread XML::Twig output problem
The output should have all ads - <nis:NISJob>...</nis:NISJob> that have a JobActiveDate of today. What I get in the output file is just the last ad - <nis:NISJob>...</nis:NISJob> in the file with today's JobActiveDate. Yup, forgot to take out some testing trash on the sub:
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 {$twig->flush;}; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: XML::Twig output problem
by plockhart (Initiate) on Jan 05, 2012 at 19:54 UTC | |
by Anonymous Monk on Jan 05, 2012 at 20:50 UTC | |
by plockhart (Initiate) on Jan 05, 2012 at 21:19 UTC |