http://www.perlmonks.org?node_id=846571

mr_p has asked for the wisdom of the Perl Monks concerning the following question:

Hello Everyone,

I would like to parse a all occurrence into an Array. Is it possible to do this? The below Is the code I have.

#!/usr/bin/perl my $str = "<item><i>headline 1</i></item> < item><i>headline2</i></item>"; my @x =~ /<(.+?)>.+<\/\1>/ for $str;

Is there a way to get all 'item' into array?

Thanks.