while () { while ( /\b ((an?) \s\W* (\w+))/gx ) { my ( $phrase, $article, $word ) = ( $1, $2, $3 ); my $bigram = "$article $word"; if ( $bigram eq A( $word )) { print "RIGHT: $phrase\n"; } else { print "WRONG: $phrase\n"; } } } __DATA__ Suitable for a (older) child or an 'early adult'.