my( $word, $guinea ) = /(\w+)?\s*\b(Guinea)\b/; if( $word eq ucfirst $word ){ warn "Not the Guinea I want ($word $guinea)"; }