Question: I have a Perl code that must read a text file that contains distinct lines.

For example:

```
blah-blah-blah yakkity-yak gobbledy_gook

doohickey thingamabob watchamacallit

one two three

```

Some days this file may have several lines, some days only one line, but each line will contain a fixed number of words with each separated by an empty space.

Basically what I have now is:

```
my @info = split (" ", $line);

```

Then a scalar check on `@info` and if it is NOT exactly three -- exit.

Is there a quicker and may be more elegant way? Thnx.

Roderick

Answer: 
The conversion to number is done automagically if you compare an array to a number:

```
die "Not enough (or too much) information\n" unless @info == 3;

```
This one liner prints all the lines with word count not equal to 3

```
perl -lane 'print if $#F!=2' FILE_NAME

```