Help for this page

Select Code to Download


  1. or download this
    $line = '127.0.0.1 - - [26/Mar/2001:16:01:07 -0500] "GET /stuff/ HTTP/
    +1.0" 200 11874'
    
  2. or download this
    use strict;
    my ($ip,$date,$method,$file,$header,$status,$pid) = $line =~ 
    ...
        (\d+)\s*$/x;    # $pid    = last set of digits
    
    print "$ip\n$date\n$method\n$file\n$status\n$pid\n";