in reply to Unexpected Array

You might want to take another look at the default behavior for split, maybe by typing perldoc -f split at the command line in your favorite shell.

Until then, if it is just that you want each word from the input appearing on a separate line, try this:

$ perl -lne 'for (split) {print}' < yourfile.txt

Try to figure out why this does what it does. Maybe you will see then what went wrong with your program.

Christian Lemburg
Brainbench MVP for Perl
http://www.brainbench.com