diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-01-15 21:43:49 -0500 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-01-15 21:43:49 -0500 |
commit | f94bd859f5a556d0f2d03f356e179deb2c8ecf8d (patch) | |
tree | 86a5149ffc247ee22d3b57b859d7c00d7d4de46a | |
parent | 5931b35f0a6f11e2365750eba01b857db46c112b (diff) |
script timestamps and cleans up after itself
-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"; |