Well, here's a method that iterates over each of the items found:
my $results = "Home Town, Log in activity: 57 DI activity: 13 FA activ
+ity: 13 FAI activity: 4 Login activity: 23 Not Found activity: 4";
foreach my $number ( $results =~ m/\d+/g ) {
print "$number\n";
}
I guess I don't understand what you're trying to do then. davido's code pulls out all the numbers into an array that you can the loop over and do whatever you like with. What exactly are you trying to do with your code?