Fix various warnings.

        Patch by kareila. 

diffs (164 lines):

diff -r f7ce0e83fc93 -r 794521415285 cgi-bin/Apache/LiveJournal.pm
--- a/cgi-bin/Apache/LiveJournal.pm     Tue Sep 14 15:24:56 2010 +0800
+++ b/cgi-bin/Apache/LiveJournal.pm     Tue Sep 14 15:34:17 2010 +0800
@@ -1178,7 +1178,7 @@ sub userpic_content
 
             # reproxy file
             else {
-                $r->headers_out->{'X-REPROXY-FILE'} => $paths->[0];
+                $r->headers_out->{'X-REPROXY-FILE'} = $paths->[0];
             }
 
             $send_headers->();
diff -r f7ce0e83fc93 -r 794521415285 cgi-bin/Apache/LiveJournal/PalImg.pm
--- a/cgi-bin/Apache/LiveJournal/PalImg.pm      Tue Sep 14 15:24:56 2010 +0800
+++ b/cgi-bin/Apache/LiveJournal/PalImg.pm      Tue Sep 14 15:34:17 2010 +0800
@@ -141,7 +141,7 @@ sub send_file
     # HEAD request?
     return OK if $r->method eq "HEAD";
 
-    open my $fh, $disk_file;
+    open my ( $fh ), $disk_file;
     return 404 unless $fh;
 
     binmode($fh);
diff -r f7ce0e83fc93 -r 794521415285 cgi-bin/DW/Shop/Engine/PayPal.pm
--- a/cgi-bin/DW/Shop/Engine/PayPal.pm  Tue Sep 14 15:24:56 2010 +0800
+++ b/cgi-bin/DW/Shop/Engine/PayPal.pm  Tue Sep 14 15:34:17 2010 +0800
@@ -205,7 +205,7 @@ sub confirm_order {
     $self->email( $res->{email} );
 
     # and now try to capture the payment
-    my $res = $self->_pp_req(
+    $res = $self->_pp_req(
         'DoExpressCheckoutPayment',
         token         => $self->token,
         payerid       => $self->payerid,
diff -r f7ce0e83fc93 -r 794521415285 cgi-bin/DW/User/Edges/WatchTrust.pm
--- a/cgi-bin/DW/User/Edges/WatchTrust.pm       Tue Sep 14 15:24:56 2010 +0800
+++ b/cgi-bin/DW/User/Edges/WatchTrust.pm       Tue Sep 14 15:34:17 2010 +0800
@@ -405,17 +405,6 @@ sub trusted_users {
 *LJ::User::trusted_users = \&trusted_users;
 
 
-# return users that trust you
-sub trusted_by_users {
-    my $u = $_[0];
-    my @trustids = $u->trusted_by_userids;
-    my $users = LJ::load_userids( @trustids );
-    return values %$users if wantarray;
-    return $users;
-}
-*LJ::User::trusted_by_users = \&trusted_by_users;
-
-
 # return users you watch
 sub watched_users {
     my $u = shift;
diff -r f7ce0e83fc93 -r 794521415285 cgi-bin/LJ/Poll.pm
--- a/cgi-bin/LJ/Poll.pm        Tue Sep 14 15:24:56 2010 +0800
+++ b/cgi-bin/LJ/Poll.pm        Tue Sep 14 15:34:17 2010 +0800
@@ -1414,7 +1414,8 @@ sub process_submission {
             ## multi-selected items are comma separated from 
htdocs/poll/index.bml
             $val = join(",", sort { $a <=> $b } split(/,/, $val));
             if (length($val) > 0) { # if the user answered to this question
-                my $num_opts = split(/,/, $val);    # returns the number of 
options they answered
+                my @num_opts = split( /,/, $val );
+                my $num_opts = scalar @num_opts;  # returns the number of 
options they answered
                 
                 my ($checkmin, $checkmax) = split(m!/!, $q->opts);
             
diff -r f7ce0e83fc93 -r 794521415285 cgi-bin/LJ/Tags.pm
--- a/cgi-bin/LJ/Tags.pm        Tue Sep 14 15:24:56 2010 +0800
+++ b/cgi-bin/LJ/Tags.pm        Tue Sep 14 15:34:17 2010 +0800
@@ -1351,7 +1351,7 @@ sub merge_usertags {
     my $exists = $tags->{$u->get_keyword_id( $newname )} ? 1 : 0;
     my %merge_from = map { $_ => 1 } @merge_from;
     return $err->( LJ::Lang::ml( 'taglib.error.mergetoexisting', { tagname => 
LJ::ehtml( $merge_to ) } ) )
-        if $exists && ! %merge_from->{$merge_to};
+        if $exists && ! $merge_from{$merge_to};
 
     # if necessary, create new tag id
     my $merge_to_id;
@@ -1405,7 +1405,7 @@ sub merge_usertags {
     if ( $exists ) {
         my %merge_to_jitemids = map { $_ => 1 } @merge_to_jitemids;
         while ( my $jitemid = $sth->fetchrow_array ) {
-            push @jitemids, $jitemid unless %merge_to_jitemids->{$jitemid};
+            push @jitemids, $jitemid unless $merge_to_jitemids{$jitemid};
         }
     } else {
         push @jitemids, $_
@@ -1417,12 +1417,12 @@ sub merge_usertags {
     # add the tag to all entries we need to change, in both logtags and 
logtagsrecent
     if ( @jitemids ) {
         foreach my $jitemid ( @jitemids ) {
-            my $sth = $u->prepare( "INSERT INTO logtags (journalid, jitemid, 
kwid) VALUES ( ?, ?, ? )");
+            $sth = $u->prepare( "INSERT INTO logtags (journalid, jitemid, 
kwid) VALUES ( ?, ?, ? )");
             return $rollback->() if $u->err || ! $sth;
             $sth->execute( $userid, $jitemid, $merge_to_id );
             return $rollback->() if $sth->err;
 
-            my $sth = $u->prepare( "INSERT INTO logtagsrecent (journalid, 
jitemid, kwid) VALUES ( ?, ?, ? )");
+            $sth = $u->prepare( "INSERT INTO logtagsrecent (journalid, 
jitemid, kwid) VALUES ( ?, ?, ? )");
             return $rollback->() if $u->err || ! $sth;
             $sth->execute( $userid, $jitemid, $merge_to_id );
             return $rollback->() if $sth->err;
@@ -1437,13 +1437,13 @@ sub merge_usertags {
 
     # while we previously only needed the jitemids of the entries we needed to 
add the tag to, we now need all the ones it is a tag on after the transaction
     # including the one it was already on before the merge
-    my $sth = $u->prepare( "SELECT jitemid FROM logtags WHERE journalid= ? AND 
kwid= ?" );
+    $sth = $u->prepare( "SELECT jitemid FROM logtags WHERE journalid= ? AND 
kwid= ?" );
     return $rollback->() if $u->err || ! $sth;
     $sth->execute( $userid, $merge_to_id );
     return $rollback->() if $sth->err;
 
     # we need all jitemids in an array for later cache clearing
-    my @jitemids;
+    @jitemids = ();
     while ( my $itemid = $sth->fetchrow_array ) {
         push @jitemids, $itemid;
     }
@@ -1452,7 +1452,7 @@ sub merge_usertags {
     # this can only get executed if the tags we are merging are actually in 
use on entries
     # since we don't need logkwsum entries for tags that exist and are not 
used on entries, we can just skip this for them
     if ( @jitemids ) {
-        my $sth = $u->prepare( "SELECT security, allowmask FROM log2 WHERE 
journalid=? AND jitemid IN (" . join( ", ", ( "?" ) x @jitemids ) . ")" );
+        $sth = $u->prepare( "SELECT security, allowmask FROM log2 WHERE 
journalid=? AND jitemid IN (" . join( ", ", ( "?" ) x @jitemids ) . ")" );
         return $rollback->() if $u->err || ! $sth;
 
         $sth->execute( $userid, @jitemids );
@@ -1492,7 +1492,7 @@ sub merge_usertags {
 
     # delete other tags from database and entries 
     foreach my $table ( qw( usertags logtags logtagsrecent logkwsum ) ) {
-        my $sth = $u->prepare( "DELETE FROM $table WHERE journalid = ? AND 
kwid IN (" . join( ", ", ( "?" ) x @merge_from_ids ) . ")" );
+        $sth = $u->prepare( "DELETE FROM $table WHERE journalid = ? AND kwid 
IN (" . join( ", ", ( "?" ) x @merge_from_ids ) . ")" );
         return $rollback->() if $u->err || ! $sth;
 
         $sth->execute( $userid, @merge_from_ids );
diff -r f7ce0e83fc93 -r 794521415285 cgi-bin/LJ/Widget/CreateAccount.pm
--- a/cgi-bin/LJ/Widget/CreateAccount.pm        Tue Sep 14 15:24:56 2010 +0800
+++ b/cgi-bin/LJ/Widget/CreateAccount.pm        Tue Sep 14 15:34:17 2010 +0800
@@ -462,7 +462,7 @@ sub handle_post {
         }
 
         my $stop_output;
-        my $body;
+        $body = undef;
         my $redirect = $opts{ret};
         LJ::Hooks::run_hook('underage_redirect', {
             u => $nu,
diff -r f7ce0e83fc93 -r 794521415285 cgi-bin/LJ/Widget/S2PropGroup.pm
--- a/cgi-bin/LJ/Widget/S2PropGroup.pm  Tue Sep 14 15:24:56 2010 +0800
+++ b/cgi-bin/LJ/Widget/S2PropGroup.pm  Tue Sep 14 15:34:17 2010 +0800
@@ -111,7 +111,7 @@ sub render_body {
 
             # use module_*_section for the dropdown 
             my $prop_name_section = $prop_name;
-            $prop_name_section =~ s/(.*)_group$/\1_section/;
+            $prop_name_section =~ s/(.*)_group$/$1_section/;
 
             my $overriding_prop_name = 
$grouped_prop_override{$prop_name_section};
 
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog

Reply via email to