package Iotta::Categorizer::SegDate;
use strict;
require Iotta::Elem;
our @ISA = ("Iotta::Elem");
sub setup {
my $self = shift;
my $o = shift;
my @segm;
$self->offset ($$o{offset}) if $$o{offset};
$self->block ($$o{block}) if $$o{block};
}
sub segment {
my $self = shift;
my $c = shift;
my $fls = shift;
my $i = $self->offset ? $self->offset : $self->block;
my $n = 0;
while ($i < scalar @$fls) {
my %sub;
my @subf = splice (@$fls, 0, $i);
$sub{files} = \@subf;
$sub{input} = $$c{input}."-$n";
$sub{title} = $$c{title}." ($n)";
push @{$$c{subs}}, \%sub;
$i = $self->block;
$n ++;
}
return $fls;
}
sub initialize {
my $self = shift;
$self->SUPER::initialize (@_);
$self->{block} = 7;
$self->{offset} = 0;
}
1;
Platon Group <platon@platon.sk> http://platon.sk/
|