use strict; use warnings; use Data::Dumper; use XML::Twig; my $xfile = <<EOF; <foo> <item><i>headline 1</i></item> <item><i>headline2</i></item> </foo> EOF my $t = new XML::Twig(); $t->parse($xfile); my @x; for my $item ($t->root()->children('item')) { push @x, $item->first_child('i')->text(); } print Dumper(\@x); __END__ $VAR1 = [ 'headline 1', 'headline2' ];
In reply to Re: Parsing with RegEx into Array
by toolic
in thread Parsing with RegEx into Array
by mr_p
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |