in reply to Problem with FIFO

Another point, instead of:

system("mknod named.pipe p");

You should probably use POSIX::mkfifo:

use POSIX 'mkfifo'; mkfifo 'named.pipe' or die "Cannot create FIFO 'named.pipe' $!";