it will kill the system-command subprocess (not just abandon it to keep running), and leave the accumulated output intact? Cool.
No, neither of those things are true, and I didn't claim they were. The OP is running ls, which should normally end on its own, even if it takes longer than 5 seconds to list the files (I'm guessing a slow network mount or similar). Which is also why I suggested IPC::Run - it supports getting partial output, plus a kill_kill method to make sure the child is killed, if either of those things are desired.
| [reply] [d/l] [select] |