Hi all.
I have a simple (I guess) question
about spliting strings in perl.
I need to split a string like this:
"10.10.2.131 - - [27/Jul/2004:08:20:43 -0300] "GET http://lalala/chiclete_01.jpg HTTP/1.0"
407 1399 TCP_DENIED:NONE" (a squid log) in some parts:
$ip = 10.10.1.131
$date = [27/Jul/2004:08:20:43
-0300]
$url_info = http://lalala/chiclete_01.jpg
$state = TCP_DENIED:NONE
How i can extract this parts
from a var eq that string?
This is the script I use to read the file and get the string
($linha) one per line:
#!/usr/bin/perl
use strict; my ($linha);
open (FILE,"<access.log"); while ( defined ($linha = <FILE>) ) {
chomp $linha; #???? what i can use ?
} |
_______________________________________________ Perl-Unix-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs