in reply to webserver common log format file script
In Perl, it is not necessary to write things like $values[ 6 ]. Instead, Perl has list slice. See slices in http://perldoc.perl.org/perldata.html. In other languages, you have to keep track of stuff like the "sixth thing" or index 6 means status, in Perl, just assign to a $status variable directly: ($status) = (split)[6]; This enhances readability.
Anyway, I would use some well known code or use a CPAN module to parse your log line. Then it would help if you explained a bit more about your troubles. You obviously seem to to understand the basics of regex. Where are you going wrong?
|
|---|