sysopen(RFD, "/usr/local/apache/logs/access_log", O_NONBLOCK); while(1){ my $buffer = ; # Do some thing with the line }