in reply to Re: Foreach Loop in Data Scraping
in thread Foreach Loop in Data Scraping

I did what you said, but it only gave me the first event, however there are 15+ events that I want to capture. I indexed the words summary and description and then began printing out what is between the indexes, however I am putting the numbers in manually each time. Is there a way for Perl to automatically go to the next index? (Instead of $My Sum1 and $My Sum2 being specific numbers)
my $substr = 'SUMMARY'; my $offset = 0; my $result = index($string, $substr, $offset); while ($result != -1) { print "$result\n"; $offset = $result + 1; $result = index($string, $substr, $offset);} my $SUM1= "298"; my $SUM2="877"; my $length = $SUM2-$SUM1; my $fragment = substr $string, 298, $length; #print " string: <$string>\n"; print " <$fragment>\n";