# switch to check if we've reached the topten list yet. my $topten = 0; my @ips; open REPORT, "reportfile" or die "Can't open reportfile: $!\n"; while () { chomp; $topten = 1 if m!^Users/Source Addresses!; next unless $topten; push @ips, [ split /\s+/ ] if /^(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/; } close REPORT;