diff options
author | Holden Rohrer <hr@hrhr.dev> | 2020-06-02 22:33:03 -0400 |
---|---|---|
committer | Holden Rohrer <hr@hrhr.dev> | 2020-06-02 22:33:38 -0400 |
commit | 85d87d47f870c692772276345655ebf8e2da7ed5 (patch) | |
tree | 09facd792d891f5cf41f775b16c62ac9e1f97e0d /minimun.orig | |
parent | 84ce497a7743bc41bb60f5c0f01453e40a9d377b (diff) |
restructuring and perliness
Diffstat (limited to 'minimun.orig')
-rw-r--r-- | minimun.orig | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/minimun.orig b/minimun.orig deleted file mode 100644 index 5ad7dc8..0000000 --- a/minimun.orig +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/perl -use strict; -use warnings; - -use IPC::Run qw(run); -use Time::HiRes qw( time ); - -chdir('%%DEST%%'); - -my ($buffer, @pairs, $pair, $name, $val, %FORM); - -if ($ENV{'REQUEST_METHOD'} eq "GET") { - $buffer = $ENV{'QUERY_STRING'}; -} -@pairs = split(/&/, $buffer); - -foreach $pair (@pairs) { - ($name, $val) = split(/=/, $pair); - $val =~ tr/+/ /; - $val =~ s/%(..)/pack("C", hex($1))/eg; - $FORM{$name} = $val; -} - -my ($in, $out); -$in = "\n"; - -if (index($ENV{'PATH_INFO'},'award.pdf') != -1){ - $in .= "\\award{$FORM{'committee'}}{$FORM{'country'}}{$FORM{'award'}}{$FORM{'school'}}"; -} -elsif (index($ENV{'PATH_INFO'},'room.pdf') != -1){ - $in .= "\\room{$FORM{'committee'}}"; -} -else{ - print "Content-type: text/html\n"; - print "Status: 404 File Not Found Error\n"; - print "\n"; - print '<a href="/">404 Error. Go back.</a>'; - die; -} - -$in .= "\\bye\n"; - -my $timestamp = time; -run ['/usr/bin/pdftex', '-jobname', "/tmp/$timestamp", 'format.tex'], '<', \$in, '>', \$out; -print "Content-type: application/pdf\n\n"; -open(DOC, '<', "/tmp/$timestamp.pdf"); -print <DOC>; -close(DOC); -unlink "/tmp/$timestamp.pdf", "/tmp/$timestamp.log"; |