my $content = get($start); my @matches; while ($content) { push(@matches, $1) if ($content =~ m/(page.php?id=\d+)/)} print @matches;