Like grep says: use strict; use warnings;
That won't catch your problem though. You're adding a space with @list1[$nk] = "$item1 \n";. Try dropping the space before the newline.
Other concerns:
Update: boo has an excellent point. I just glossed by that point.
In reply to Re: Alphabetical order with .txt file
by lemming
in thread Alphabetical order with .txt file
by Jaxonn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |