in reply to Re^2: XML::Twig Output Help
in thread XML::Twig Output Help
use warnings; use strict; use XML::Twig; my $file = 'PYR.xml'; my $twig = new XML::Twig( KeepSpaces => 'true', TwigHandlers => { "JOB " => \&Output} ); $twig->parsefile($file); sub Output { my ($twig, $s) = @_; print 'Jobname = ', $s->att('JOBNAME') , "\n"; print 'Weekdays = ', $s->att('WEEKDAYS'), "\n"; }
prints to STDOUT:
Jobname = BPYRD000-PYRPACK-START-HOUSEKEEP Weekdays = 1,2,3,4,5
|
|---|