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


in reply to Foreach Loop in Data Scraping

You need to use a while loop, like this:

while ( $string =~ /(SUMMARY.+?DESCRIPTION)/ig ) { print "Summary: $1\n"; ## prints title of event }