<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;"># This -*- perl -*- script makes the forwd_demo script
# $Id: forwd_demo.PL,v 1.2 1997/01/16 20:43:34 gbarr Exp $

use Config;
use Cwd;

$script = "./forwd_demo";
unlink($script);

open MIR, "&gt;$script" or die "open for writing $script: $!";
print MIR $Config{'startperl'}," -w\n";
$cwd = Cwd::getcwd();
#print MIR "use lib qw($cwd/blib);\n";
print MIR &lt;DATA&gt;; 
chmod(0755, $script);

__DATA__
use Mail::Internet;

@mail = &lt;&gt;;

$mail = Mail::Internet-&gt;new(\@mail);

$mail-&gt;remove_sig;
$mail-&gt;tidy_body;

@reply = ();
if(open(HDR,"$ENV{HOME}/.mailhdr")) {
 @reply = &lt;HDR&gt;;
 close(HDR);
}

$rply = Mail::Internet-&gt;new(\@reply);

$subject = $mail-&gt;get('Subject');

$rply-&gt;replace('To', "");
$rply-&gt;replace('Cc', "");
$rply-&gt;replace('Subject',$subject);

$rply-&gt;body($body = $mail-&gt;body);

unshift @{$body},"---------- Begin Included Message ----------\n";
push    @{$body},"----------- End Included Message -----------\n";

$file = "/tmp/reply.$$";

open(FILE,"&gt;$file") || die "Cannot open $file:$!\n";

$rply-&gt;print(\*FILE);

close(FILE);

$editor = $ENV{"EDITOR"} || "/usr/bin/nvi";

warn "$editor :$!\n" if (system("$editor $file"));

unlink($file,$file . '%');

exit 0;

</pre></body></html>