Backed out changeset 5a22524e7261 - path detection does not work
authorheiko
Fri, 13 May 2011 10:26:06 +0200
changeset 15 38a3e4aa59c0
parent 14 5a22524e7261
child 16 a4a87929803f
child 20 c1e9c225237b
Backed out changeset 5a22524e7261 - path detection does not work
upload.pl
--- a/upload.pl	Fri May 13 10:21:00 2011 +0200
+++ b/upload.pl	Fri May 13 10:26:06 2011 +0200
@@ -26,12 +26,13 @@
 use CGI qw(:all *table);
 use CGI::Carp qw(fatalsToBrowser);
 use CGI::Pretty;
+use IO::File;
 use File::Basename;
 use Digest::MD5 qw(md5_hex);
 use OSSP::uuid;
 
 my $DIR     = "d/{view}";
-my $DIR_URI = url(-absolute => 1) . "/$DIR";
+my $DIR_URI = "/$DIR";
 
 sub human($);
 
@@ -67,8 +68,7 @@
 
     print header(-charset => "UTF-8"),
       start_html(-title => "Up&Down"),
-      h1("Ansicht: $ENV{REMOTE_USER}"),
-	  "dir: ", url(-absolute => 1);
+      h1 "Ansicht: $ENV{REMOTE_USER}";
 
     # print Dump;
 
@@ -89,16 +89,16 @@
 
         my $dir = "$DIR/$uuid-$expires";
         mkdir $dir, 0750 or die "Can't mkdir $dir: $!\n";
-        open(my $outfh, ">", "$dir/$filename")
+        my $outfh = new IO::File ">$dir/$filename"
           or die "Can't create $dir/$filename: $!\n";
         print {$outfh} <$file>;
 
-        if (open(my $atfh, "|-", "at now + $days days")) {
+        if (my $atfh = new IO::File("|at now + $days days")) {
             print {$atfh}
               "rm -f \"$dir/$filename\"\n",
               "rmdir \"$dir\"\n";
             close $atfh;
-			#system("cat /tmp/log");
+            system("cat /tmp/log");
         }
 
     }