Next Lightweight Databases 60

Rotating Log File

        tie @LOG, 'Tie::File', '/etc/logfile';
        sub log {
          push @LOG, @_;
          my $overflow = @LOG - 100;
          splice @LOG, 0, $overflow if $overflow > 0;
        }


Next Copyright © 2003 M. J. Dominus