http://qs321.pair.com?node_id=1130843


in reply to Re^3: Question about the most efficient way to read Apache log files without All-In-One Modules from CPAN (personal learning exercise)
in thread Question about the most efficient way to read Apache log files without All-In-One Modules from CPAN (personal learning exercise)

"...He did ask for a learning exercise..."

Yes, but i didn't reply to the OP.

"...break the composite fields down..."

Yes, sure. Perhaps like this:

karls-mac-mini:monks karl$ perl -E ' say split /[\[\]]/, qq([22/Apr/20 +15:13:35:04 +1000])' 22/Apr/2015:13:35:04 +1000 karls-mac-mini:monks karl$ perl -E ' say split /"/, qq("GET /bin/admin +.pl HTTP/1.1")' GET /bin/admin.pl HTTP/1.1 karls-mac-mini:monks karl$ perl -E 'say join "\t", split /\s/, qq(GET +/bin/admin.pl HTTP/1.1)' GET /bin/admin.pl HTTP/1.1 # usw...

I just wanted to show wrog that a solution that only uses split is possible.

Another question is this it is desirable if this is desirable. I guess some may call it abuse.

Edit: Better wording.

Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»