--- 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");
}
}