<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">#!/tmp/perl

$responses = '/tmp/foo';
$mailcommand = '|/bin/mail';

$/ = '';
$mail = (&lt;&gt;);

$mail =~ /\nSubject: (.+)/;
$subject = $1;

$mail =~ /\nFrom: (.+)/;
$from = $1;

chdir($responses);
@files = (&lt;*&gt;);

srand;
$file = $files[rand($#files+1)];

open(FILE, $file);
$response = (&lt;FILE&gt;);
$response =~ s/SUBJECT/$subject/;

open(MAIL, "$mailcommand $from");
print(MAIL, "$response");
close(MAIL);
</pre></body></html>