in reply to `cat $myfile`; vs. open(MYHANDLE, "myfile")
Yes, I think your problem comes from the newlines in each line in the array.
Try doing this instead:
chomp(my @myarray=`cat $myfile`); [download]
That will remove the newline from the end of each line.