in reply to Re^2: XML::Twig Output Help
in thread XML::Twig Output Help

Corion was basically right. I tidied up your code, removed the redundant output to a file (for simplicity) so that output just goes to STDOUT, and fixed the print statements:
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