It would probably help you immensely if you followed these oft-spoken guidelines while debugging your code:
call is missing an argument. In your third chunk of code, you're opening the LL file handle but reading from the PM file handle. Again, 'use strict' and '-w' would have caught this. As far as the array in the 2nd chunk of code, perhaps it's failing to open the file for some reason? Check for the success/failure of
to see.