# system() return value is backwards, so "and" not "or"

#

$ENV{PATH} .= ":/etc:/usr/etc";

if  (      system('mknod',  $path, 'p') 

       and system('mkfifo', $path) )

{

    die "mk{nod,fifo} $path failed;

} 



chdir; # go home

$FIFO = '.signature';

$ENV{PATH} .= ":/etc:/usr/games";



while (1) {

    unless (-p $FIFO) {

        unlink $FIFO;

        system('mknod', $FIFO, 'p') 

            && die "can't mknod $FIFO: $!";

    } 



    # next line blocks until there's a reader

    open (FIFO, "> $FIFO") or die "can't write $FIFO: $!";

    print FIFO "John Smith (smith\@host.org)\n", `fortune -s`;

    close FIFO;

    sleep 1;    # to avoid dup sigs

}

