my $line; while($line = ) { if ($line =~ /pond.*\((\w+)\)/) { print "$1\n"; } } close(PAGE);