##
$WANT = 3;
$count = 0;
while (/(\w+)\s+fish\b/gi)
{
if (++$count == $WANT)
{
print "The third fish is a $1 one.\n";
# Warning: don't `last' out of this loop
}
}
####
/(?:\w+\s+fish\s+){2}(\w+)\s+fish/i;