10 my ($temp_file,$quote_file) = @ARGV;
11 $temp_file ||= User->Home."/lib/signature_stuff/sigtemplate.txt";
12 $quote_file ||= User->Home."/lib/signature_stuff/quote.txt";
14 my $sigfile = new IO::File User->Home."/.signature", 'w' or die "Unable to open ~/.signature for writing; $!";
15 my $templatefile = new IO::File $temp_file, 'r' or die "Unable to open $temp_file $!";
18 my $template =<$templatefile>;
24 if (-e $quote_file.'.dat' and open($fortune,'-|','fortune',$quote_file)) {
32 my $quotesfile = new IO::File $quote_file,'r' or die "Unable to open $quote_file $!";
34 $quotes = <$quotesfile>;
36 my @quotes = split /\n*\%\n*/s, $quotes;
38 my $quote = $quotes[rand(@quotes)];
42 $template =~ s/\[\%\s*quote\s*\%\]/$quote/;
44 print {$sigfile} $template;