Hello Chasey and Akshay!
> You could use a regex:
>
> $log_line =~ /([\d.]+)\s/;
> my $ip_addr = $1;
> IP numbers have the format ddd.ddd.ddd.ddd ranging from 1 to 3 digits,
> so
> if(/$(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) would grab the IP and put it
> in $1
> the above will match IP numbers
>
> for this program, you can also use something simpler like
> if(/$(\S+)/)
> this will just grab all non space chars at the beginning of the line
The begining of the line doesn't start from ^?
I would rather use this:
if (/^[\d+.]+/)
or
if (/^[\d{1,3}.]{3}\d{1,3}/)
So why do you need \s to the end of the regexp? If the Apache log works
well. :-)
Check if this works.
Chris
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]