I recently ran into a problem where whenever I would call a shell command using backticks in perl, the program would hang and never exit. I spent a good bit of time tracking down the source of the problem and it turns out that if your shell command returns more than 4096 bytes of output (1 page of memory), microperl doesn't know what to do and just sits there and hangs.
I have several scripts for parsing wireless survey results that are written in perl and generate large amounts of output. Does anyone know of a way to workaround this problem or compile microperl with some sort of option that will allow more output? Even trying to use system() and sending the output to a text file that I can read from doesn't work. The best solution would be one that fixes perl itself rather than changing my scripts, so that if there are any other places in the code that generate lots of output, they'll work without changing anything.
ls -l /tmp/sample.txt
-rw-r--r-- 1 root root 4181 Jan 1 00:50 sample.txt
perl code (note that this is just sample code to illustrate the problem):
print `cat /tmp/sample.txt`; # hangs
system('cat /tmp/sample.txt'); # works
system('cat /tmp/sample.txt > /tmp/copy.txt'); # hangs