in reply to ignoring blank lines

You could do this on the command line, a script hardly seems necessary.

$ cat spw841608.txt ile ass ass array rat rasa arrow ant sad jack sprat cat on a mat joe blow $ $ perl -ne 'print if 2 == split' spw841608.txt ass ass rat rasa arrow ant jack sprat joe blow $

I hope this is helpful.

Cheers,

JohnGG