Subject: | chomp() should go back to parse() |
Date: | Fri, 2 Oct 2015 11:17:03 -0700 |
To: | bug-Apache-LogRegex [...] rt.cpan.org |
From: | Peter Scott <Peter [...] PSDT.com> |
Recent versions removed
chomp($line)
from parse(). This appears to be a mistake. Consider the end of a
regex generated for a format that ends in "%H %V %{SSL_PROTOCOL}x %D":
/(.+?)\s+(\S*)\s+(\S*)\s+(\S*)\s*/
Now match that against a chomped vs nonchomped string:
$_ = 'a b c
';
### TWO spaces after 'a'
print Dumper [ /(.+?)\s+(\S*)\s+(\S*)\s+(\S*)\s*/ ];
chomp;
print Dumper [ /(.+?)\s+(\S*)\s+(\S*)\s+(\S*)\s*/ ];
$VAR1 = [
'a',
'b',
'c',
''
];
$VAR1 = [
'a',
'',
'b',
'c'
];
The last \s+ matches newline.