You may wish to use this much faster method......
my $lines = 10;
my @stack = ();
open(LF, $db_file_name) or die "Error opening $db_file_name : $!\n";
while (<LF>) {
shift @stack if ($stack[$lines - 1]);
push @stack, $_;
}
close(LF);
print @stack;
}
Then just put &lastx; in html.pl
Code:
sub lastx { my $lines = 10;
my @stack = ();
open(LF, $db_file_name) or die "Error opening $db_file_name : $!\n";
while (<LF>) {
shift @stack if ($stack[$lines - 1]);
push @stack, $_;
}
close(LF);
print @stack;
}
Then just put &lastx; in html.pl