Yes, I think your problem comes from the newlines in each line in the array.
Try doing this instead:
chomp(my @myarray=`cat $myfile`);
That will remove the newline from the end of each line.
In reply to Re: `cat $myfile`; vs. open(MYHANDLE, "myfile")
by liverpole
in thread `cat $myfile`; vs. open(MYHANDLE, "myfile")
by bw
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |