]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
split-logfile: Fix perl error: 'Can't use string ("example.org:80")
authorEric Covener <covener@apache.org>
Wed, 31 Dec 2014 15:39:02 +0000 (15:39 +0000)
committerEric Covener <covener@apache.org>
Wed, 31 Dec 2014 15:39:02 +0000 (15:39 +0000)
  as a symbol ref while "strict refs"'. PR 56329.

Submitted By: Holger Mauermann <mauermann gmail.com>
Committed By: covener

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1648719 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
support/split-logfile.in

diff --git a/CHANGES b/CHANGES
index c6b600ccbdc9a7b307b084e62d1f5e512c84c8c4..b3c9af7518329c1dec6796fbb0d5869fa3a18019 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) split-logfile: Fix perl error:  'Can't use string ("example.org:80") 
+     as a symbol ref while "strict refs"'. PR 56329.
+     [Holger Mauermann <mauermann gmail.com>]
+
   *) mod_proxy: Prevent ProxyPassReverse from doing a substitution when
      the URL parameter interpolates to an empty string. PR 56603.
      [<ajprout hotmail.com>]
index 59eda713f9a64cee7aa56a78e5d3b75be32f331c..e5abfc7d250040d3b33b82c1262322612ffcefa0 100644 (file)
@@ -29,7 +29,7 @@
 use strict;
 use warnings;
 
-my %is_open = ();
+my %log_file = ();
 
 while (my $log_line = <STDIN>) {
     #
@@ -54,10 +54,9 @@ while (my $log_line = <STDIN>) {
     # If the log file for this virtual host isn't opened
     # yet, do it now.
     #
-    if (! $is_open{$vhost}) {
-        open $vhost, ">>${vhost}.log"
+    if (! $log_file{$vhost}) {
+        open $log_file{$vhost}, ">>${vhost}.log"
             or die ("Can't open ${vhost}.log");
-        $is_open{$vhost} = 1;
     }
     #
     # Strip off the first token (which may be null in the
@@ -65,6 +64,6 @@ while (my $log_line = <STDIN>) {
     # record to the current log file.
     #
     $log_line =~ s/^\S*\s+//;
-    printf $vhost "%s", $log_line;
+    print {$log_file{$vhost}} $log_line;
 }
 exit 0;