in reply to Somewhat basic but long, practical RE problem

The Perl Cookbook has
while(<LOGFILE>) { my ($client,$identuser,$authuser,$date,$time,$tz,$method,$url,$protoco +l,$status,$bytes) = /^(\S+) (\S+) (\S+) \[([^: ]+):(\d+:\d+:\d+) ([^\ +]]+) "(\S+) (.*?) (\S+)" (\S+) (\S+)$/; #... }
on page 726 (20.12 Parsing a Web Server Log File). Also check 20.13 (Processing Server Logs) for a snippet with format, or check Logfile::Apache.
Cookbook examples are online here.

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: Somewhat basic but long, practical RE problem
by nysus (Parson) on Jul 02, 2001 at 10:40 UTC
    I would have never thought to put in a plain old space character in a regular expression---I've just never even seen it done before. Interesting and thanks.

    Update: I should be putting these kinds of comments in the chatterbox, no?

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks