From: ndparker <> Date: Sun, 17 Jun 2001 09:48:31 +0000 (+0000) Subject: made perl 5.005 compilant X-Git-Url: https://git.p6c8.net/selfforum.git/commitdiff_plain/8bd9a0d82f7e21d9340a4470258e2cad2638deca made perl 5.005 compilant --- diff --git a/selfforum-cgi/shared/Arc/Archive.pm b/selfforum-cgi/shared/Arc/Archive.pm index 9e6694b..9e3ccb9 100644 --- a/selfforum-cgi/shared/Arc/Archive.pm +++ b/selfforum-cgi/shared/Arc/Archive.pm @@ -181,9 +181,9 @@ sub cut_tail ($) { my $monthpath = $monthdir . '/'; my $file = $monthpath . "t$tid.xml"; - mkdir $yeardir unless (-d $yeardir); + mkdir $yeardir, 0777 unless (-d $yeardir); if (-d $yeardir) { - mkdir $monthdir unless (-d $monthdir); + mkdir $monthdir, 0777 unless (-d $monthdir); if (-d $monthdir) { save_file ( $file, diff --git a/selfforum-cgi/shared/Conf.pm b/selfforum-cgi/shared/Conf.pm index ca39efd..c0920d0 100644 --- a/selfforum-cgi/shared/Conf.pm +++ b/selfforum-cgi/shared/Conf.pm @@ -164,6 +164,8 @@ sub parse_script_conf ($\%$) { # $Shared - /path/to/shared-dir # -- " -- # $Script - scriptname # +# Return: hashref of config hash +# sub read_script_conf ($$$) { my ($Config, $Shared, $Script) = @_; diff --git a/selfforum-cgi/shared/Posting/Cache.pm b/selfforum-cgi/shared/Posting/Cache.pm index cf8c3c4..b765a49 100644 --- a/selfforum-cgi/shared/Posting/Cache.pm +++ b/selfforum-cgi/shared/Posting/Cache.pm @@ -25,7 +25,7 @@ use Lock qw(:ALL); # $VERSION = do { my @r =(q$Revision$ =~ /\d+/g); sprintf "%d."."%02d" x $#r, @r }; -my $O_BINARY = eval "O_BINARY"; +my $O_BINARY = eval 'local $SIG{__DIE__}; O_BINARY'; $O_BINARY = 0 if ($@); ### sub new #################################################################### @@ -416,10 +416,9 @@ sub r_add_posting { local $\; unless (-d $self -> threaddir($param)) { - mkdir $self->threaddir($param) or return; + mkdir $self->threaddir($param), 0777 or return; } - sysopen ( - FILE, + sysopen (FILE, $self->cachefile($param), O_WRONLY | O_CREAT | O_TRUNC ) or return; @@ -530,7 +529,7 @@ sub vote_wrap { } else { unless (-d $self->threaddir($param)) { - mkdir $self->threaddir($param) or return; + mkdir $self->threaddir($param), 0777 or return; } my $filename = $self->cachefile($param); diff --git a/selfforum-cgi/shared/Template.pm b/selfforum-cgi/shared/Template.pm index 16562c9..4e19eb2 100644 --- a/selfforum-cgi/shared/Template.pm +++ b/selfforum-cgi/shared/Template.pm @@ -4,8 +4,8 @@ package Template; # # # File: shared/Template.pm # # # -# Authors: André Malo , 2001-04-12 # -# Frank Schoenmann , 2001-06-04 # +# Authors: André Malo , 2001-06-16 # +# Frank Schoenmann , 2001-06-04 # # # # Description: Handle XML based HTML-Templates # # # diff --git a/selfforum-cgi/shared/Template/Forum.pm b/selfforum-cgi/shared/Template/Forum.pm index 245bb5e..6754941 100644 --- a/selfforum-cgi/shared/Template/Forum.pm +++ b/selfforum-cgi/shared/Template/Forum.pm @@ -105,6 +105,7 @@ sub print_forum_as_HTML ($$$) { for (@threads) { $tpar -> {thread} = "$_"; + $|++; print ${html_thread ($threads -> {$_}, $template, $tpar)},"\n",'
 
',"\n";} print "\n",${$template -> scrap ($assign -> {mainDocEnd})};} diff --git a/selfforum-cgi/shared/Template/Posting.pm b/selfforum-cgi/shared/Template/Posting.pm index 64b0537..57c6b2a 100644 --- a/selfforum-cgi/shared/Template/Posting.pm +++ b/selfforum-cgi/shared/Template/Posting.pm @@ -163,6 +163,7 @@ sub print_posting_as_HTML ($$$) { }) } if (%$pheader); + $|++; print ${$template -> scrap ( $assign->{mainDoc}, { $assign->{name} => plain(defined $header->{name} ? $header->{name} : ''), diff --git a/selfforum-cgi/user/fo_voting.pl b/selfforum-cgi/user/fo_voting.pl index 8ab2d0f..c8b9f9c 100644 --- a/selfforum-cgi/user/fo_voting.pl +++ b/selfforum-cgi/user/fo_voting.pl @@ -70,8 +70,8 @@ my $voted; my ($tid, $mid) = map {$_ || 0} split /;/ => $fup, 2; -$tid = ($tid=~/(\d+)/)[0] || 0; -$mid = ($mid=~/(\d+)/)[0] || 0; +$tid = (defined $tid and $tid=~/(\d+)/)? $1: 0; +$mid = (defined $mid and $mid=~/(\d+)/)? $1: 0; if ($tid and $mid and $unid) {