saibsk
asked on
perl tail log
while(1) {
my ($nfound,$timeleft,@pendin g)= File::Tail::select(undef,u ndef,undef ,'60',$log );
unless ($nfound) {
print nothing;
}
else {
my $line = $log->read;
print $line;
}
But I want to do someting like
tail the file
if nothing in the file then sleep for 1 min and then print nothing
if something in the file just print the message without sleeping please advise
my ($nfound,$timeleft,@pendin
unless ($nfound) {
print nothing;
}
else {
my $line = $log->read;
print $line;
}
But I want to do someting like
tail the file
if nothing in the file then sleep for 1 min and then print nothing
if something in the file just print the message without sleeping please advise
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
how does that differ from the original code?
ASKER