Thread Letzte 10 Zeilen einer Textdatei ausgeben (73 answers)
Opened by TrioxX at 2006-12-03 12:20

renee
 2006-12-06 12:48
#9287 #9287
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Dann sollte es ungefähr so gehen:

Marke im Template: {FRB|File.txt|10}

Dann Plugin.pm:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package GTChat::Plugins::MyPlugin;

use File::ReadBackwards;

return bless({
template_command_handlers => {
FRB => \&read_backwards,
},
});

sub read_backwards{
my ($self, $main, $params, $output) = @_;

my ($tag, $file,$linecount) = @$params;
my $frb = File::ReadBackwards->new( $file ) or
die "can't read $file $!";
for(1..$linecount){
$$output .= $frb->readline();
}
}
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread Letzte 10 Zeilen einer Textdatei ausgeben