while (my $line = <FH>) { $line =~ m/\s([\w ]+? PRIMARY SCHOOL)/ || next; push @schools, $1; }
Or you could get sneaky:
@schools = grep {/\s([\w ]+? PRIMARY SCHOOL)/; $_ = $1} <FH>;
In reply to Re: Why repeated matches...
by delirium
in thread Why repeated matches...
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |