#!/usr/bin/perl -w open(FILE, 'test.xml') or die $!; my $xml = join('', ); while($xml =~ m!([\w\s]+)!g) { print $1, "\n"; }