#!/usr/bin/perl -w -l use strict; use XML::Twig; my $name= live_free() or die; my $t= XML::Twig->new( twig_roots => { qq{header[\@name="$name"]} => \&print_content }, ); $t->parse( \*DATA); sub print_content { my( $t, $header)= @_; print join( "\n", map { $_->text } $header->children); } sub live_free { return shift @ARGV; } __DATA__
WTO
WTO Call
Call
WTO SMS NetSend