)) {
push(@file,$_."\n");
next if (/^\s*(\#.*)?$/);
s/^\s*//;
($pause,$url) = split(' ',$_,2);
$steps[++$step] = "$pause $url";
}
close (FILE);
($pause && $url) ||
&abort("couldn't find needed info in $in{'file'}\n");
$step = $in{'step'};
($pause, $url) = split(' ', $steps[$step]);
$step++;
if ($steps[$step]) { # pass the buck ...
$refreshline = "Refresh: $pause;URL=$this_script?file=$in{'file'}&step=$step\n";
} else { # the buck has to stop somewhere, hm?
$refreshline = "";
}
print <<"EOREDIRECT";
Location: $url
${refreshline}Content-type: text/html
Document moved
Document moved
This document has moved to $url. This script will call $this_script again in $pause seconds.
EOREDIRECT
exit;
}
sub abort {
$" = "\n";
print <<"EOABORT";
Content-type: text/html
Doh. Stuff ain\'t working like it should. Consider this an abortion.
The complaint, specifically, is:
$_[0]
Diagnostics:
\$url: $url
\$this_script: $this_script
\$step: $step
\$in{'file'}: $in{'file'}
\$in{'step'}: $in{'step'}
contents of file:
@file
EOABORT
exit;
}