Hi All,

I have tested the following script for reading the log files and write
in to the file,


#!/usr/bin/perl
use strict;
use warnings;
use File::Tail;
my $file=File::Tail->new("/log/path");
while (defined(my $line=$file->read))
{
my ($time,$lport,$ip,$stats,$rport)=split" ",$line;
&writedata;
sub writedata 
{
open FF,">>/tmp/test || die "can't create file  /tmp/test $!";
printf FF "$time,$lport,$ip,$stats,$rport";
close FF;
}


I have get an error .. could u help me to rectify?

Thanks,
Siva 



Reply via email to