splitting a mail log file

E

eight02645999

hi
i have a mail log file to split which has these fields
<date><spaces><time><spaces><GMT><spaces><transaction><spaces><message>

i tried to write it like this
....
while ( my $line = <$LOG> )
{
my ($date,$time,$gmt,$tran,$msg) = split('\s+' , $line);
.....

}

but the problem is in the <message>, there are also spaces. For example
2005/06/01 18:30:13 GMT+06:00 6F0C71E6 Forwarding mail for blahblah

so my $msg will contain "Forwarding" only. What is a better way to
split and
get the whole message into $msg?
thanks for any advice.
 
J

John Bokma

so my $msg will contain "Forwarding" only. What is a better way to
split and
get the whole message into $msg?

perldoc -f split and read the first line. (Also the pattern part).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top