TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Signatures - Was: Netscape and fonts..



Speaking of cool things to do with signatures, this
is what you're all really looking for, and you can
adapt it to your needs.

           $FIFO = '/home/nick/.sig';
           $ENV{PATH} .= ":/etc:/usr/games"; # Because fortune is usually here

           while (1) {
               unless (-p $FIFO) {
                   unlink $FIFO;                                     # Make 
sure the FIFO isn't already there
                   system('mknod', $FIFO, 'p')
                       && die "can't mknod $FIFO: $!";
               }

               # next line blocks until there's a reader
               open (FIFO, "> $FIFO") || die "can't write $FIFO: $!";
               print FIFO "Nick Reinking (nick\@nospam.sigfs.org)\n", `fortune 
-s`;
               close FIFO;
               sleep 2;    # to avoid dup signals
           }

This code was ruthlessly stolen from the perlipc man page.  Sorry folks.
(I could have come up with this myself, but it's easier just to copy
and paste)

Nick Reinking