You could just use parseString() on the result of ipcReadProcess - e.g. parseString(ipcReadProcess(cid 5) "\n") to split the strings on the carriage return. Other than that you'll have to create some kind of handshaking protocol between the two - and make sure you flush the output in perl after writing each line. By handshaking I mean you'd have to read a line in SKILL, and then send a message back using ipcWriteProcess, and have your perl script wait until it gets the message back before writing the next string.
It's not that clear what you really want to do here or why it needs to do this one at a time. In fact if you only want to read the file and print it out, just doing printf("%s" ipcReadProcess(cid 5)) would be sufficient. So you could do:
printf("%s" ipcReadProcess(cid 5))
BTW - not sure why you posted this in the Custom IC SKILL forum if you're using Allegro SKILL - there's a PCB SKILL forum which would be more appropriate. However, the code above should work in both Virtuoso and Allegro environments, I believe.