well, this is the way I do it, after reading whois' writeup on "I am not a hacker", and deciding to finally ditch the awk/csh frankenstein-looking scripts that I wrote in the first semester of my freshman year of college, before I knew much about Unix and Perl. (don't worry, I am not going to node that monstrosity, at least until someone asks me to...)

#!/usr/local/bin/perl
$H=$ENV{"HOME"};
open SL, "$H/.siglist" or die; 
open SD, "$H/.sigdefault" or die;
open SIG, ">$H/.signature" or die;

srand();

$/="";

while(<SL>)
{
   if( rand($.)<1 ) { $x=$_ }
}

chomp $x;
print SIG "$x\n";

$x=<SD>;
print SIG $x

as a note, ~/.siglist is in the form of

"pithy quote"
       -- Source

"another pithy quote"
       -- An Unlikely Source

... (more mighty fine quotes) ...
and my ~/.sigdefault (which is somewhat of a misnomer; ".sigtail", or something, might have been more appropriate) is:
------------------
Benjamin Strautin
bis@alumni.duke.edu
(DOH! you've tricked me into giving out my email address!)

Log in or register to write something here or to contact authors.