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 $!";
16 my $quotesfile = new IO::File $quote_file,'r' or die "Unable to open $quote_file $!";
20 while (<$templatefile>) {
28 while (<$quotesfile>) {
34 my @quotes = split /\n*\%\n*/s, $quotes;
37 my $quote = $quotes[rand($#quotes+1)];
39 $template =~ s/\[\%\s*quote\s*\%\]/$quote/;
41 print {$sigfile} $template;