#!/usr/bin/env perl use strict; use warnings; use Lingua::EN::Inflect 'A'; while () { while ( /\b (an? \s (\w+))/gx ) { my ( $phrase, $word ) = ( $1, $2 ); if ( $phrase eq A( $word )) { print "RIGHT: $phrase\n"; } else { print "WRONG: $phrase\n"; } } } __DATA__ I am a howling maniac in an hospital. It takes a hour to win an honorable mention. Calling him a umpire is a euphemism. This is a united front against a evil empire.