Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: XML::Twig output problem

by toolic (Chancellor)
on Jan 05, 2012 at 18:12 UTC ( #946443=note: print w/ replies, xml ) Need Help??


in reply to XML::Twig output problem

The code you posted has compile errors for me (DumpOldAds and extra semicolons). Are you sure this is the code you are using? If not, please update the OP.

Also, please post the exact output you expect.


Comment on Re: XML::Twig output problem
Re^2: XML::Twig output problem
by plockhart (Initiate) on Jan 05, 2012 at 19:14 UTC

    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;}; }

      Make that the first ad not the last, sorry, long week. If I flush it, it deletes all the ads even though the comparison is valid to keep them!

        If I flush it, it deletes all the ads even though the comparison is valid to keep them!

        Sounds like nonsense. flush is used for printing the twig to output. If that isn't what you want, stop flushing

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (9)
As of 2014-08-20 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (107 votes), past polls