Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
        m/^(\S+) - - \[(\S+ [-+]\d{4})\] "(\S+ \S+ [^"]+)" (\d{3}) (\d+|-)
    + "(.*?)" "([^"]+)"$/
        or warn "match failed!";
    print "$host\n$date\n$url_with_method\n$status\n$size\n$referrer\n$age
    +nt\n";
    
  2. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    else {
        warn "match failed!";
    }