in reply to Extracting XML data from a tree

The handler toolic describes is capable of working with large files.
Alternatively, you could use xpath:
#!/usr/bin/perl use strict; use warnings; use XML::Twig; use v5.10; my $twig = XML::Twig->new(); $twig->parsefile( 'CC.xml'); my $looking_for_day = 'Tuesday'; foreach my $node ($twig->get_xpath('//Day[@day_of_week="' . $looking_f +or_day . '"]/Times/Time')) { say $node->att('start-time'); }

Replies are listed 'Best First'.
Re^2: Extracting XML data from a tree
by toolic (Bishop) on Jun 04, 2013 at 14:29 UTC
    One small correction: change day_of_week to day-of-week:
    foreach my $node ($twig->get_xpath('//Day[@day-of-week="' . $looking_f +or_day . '"]/Times/Time')) {
      Whoops, yes...I had a bit of trial and error getting it to work, and changed the -'s to _'s, but forgot to change them back when posting the code.
      Thanks for the correction.