diff options
-rwxr-xr-x | minimun | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -3,16 +3,19 @@ use strict; use warnings; use IPC::Run qw(run); +use Time::HiRes qw( time ); -my ($in, $out); +my $in; $in .= "\\award\n"; $in .= "\\bye\n"; -run ['/usr/bin/pdftex', 'format.tex'], '<', \$in, '>', \$out; +my $timestamp = time; +run ['/usr/bin/pdftex', '-jobname', "$timestamp", 'format.tex'], '<', \$in; print "Content-type: application/pdf\n\n"; -open(DOC, '<', 'format.pdf'); +open(DOC, '<', "$timestamp.pdf"); while (<DOC>){ print; } close(DOC); +unlink "$timestamp.pdf", "$timestamp.log"; |