Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: [SOLVED] Splitting a file using "common log format" help

by trizen (Hermit)
on Nov 10, 2012 at 23:20 UTC ( #1003290=note: print w/replies, xml ) Need Help??


in reply to [SOLVED] Splitting a file using "common log format" help

Using Text::ParseWords.
use strict; use warnings; use Text::ParseWords; while (<DATA>) { if (s/(\[.*?\])//) { my $dateTime = $1; my ($remoteIP,$rfc,$userID,$requestType,$statusCode,$sizeOfFil +e) = quotewords(qr/\s+/, 0, $_); print "<$remoteIP> <$rfc> <$userID> <$requestType> <$statusCod +e> <$sizeOfFile>\n"; } } __DATA__ 66.249.65.107 - - [08/Oct/2007:04:54:20 -0400] "GET /support.html HTTP +/1.1" 200 11179

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1003290]
help
Chatterbox?
[LanX]: hippo you asked about translating Asterix ?
[Eily]: Maybe the puns in his dialogues were somehow kept through translation, but I can tell he lost his accent
[LanX]: qui?
[Eily]: Astérix
1nickt gives up on finding a Perl YAML parser that supports hash merging. In 2017.
[LanX]: Oh yes true, he lost his accent! xD
[Eily]: and since his name is a modified version of astérisque (asterisk), which is a typographical symbol, I think it's even funnier that he would lose a diacritic

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2017-05-24 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?