from a Windows laptop running Perl via serial port
Because this is Windows, the default :crlf PerlIO layer is converting your "ls\n" into "ls\x0D\x0A" (i.e., CRLF), which might be the source of your issues. Try binmode PORT; after your open to see if that helps. If it doesn't help, you'll have to check the specifications of the serial protocol for what is expected.
By the way, Use strict and warnings, and see also "open" Best Practices in regards to using three-agrument open and lexical filehandles.