Súbor: [Platon] / iotta / Iotta / Format / Auto.pm (stiahnutie)
Revízia 1.2, Sun Mar 23 11:29:56 2003 UTC (21 years ago) by yenar
Zmeny od 1.1: +2 -2
[lines]
use chain-provided module instantiation [Iotta/Format/Auto.pm]
|
package Iotta::Format::Auto;
use base Iotta::Elem;
sub run {
my $s = shift;
my $m = shift;
my $in = shift;
my $fi;
my $fo;
my $infmt = $$m{format};
$infmt =~ s/^(.)/$a = $1; $a =~ tr@a-z@A-Z@; $a/e;
$infmt =~ s/[-_](.)/$a = $1; $a =~ tr@a-z@A-Z@; $a/ge;
$infmt =~ s/-/_/g;
$fi = $s->chain->mod_inst("Iotta::Format::In::".$infmt); #FIXME?
$fo = $s->chain->mod_inst("Iotta::Format::Out::".$s->outfmt);
$fi->next ($fo);
$fo->next ($s -> next);
#$s->next->run ($m, $out) if ($s->next);
$fi->run ($m, $in);
}
sub setup {
my $self = shift;
my $o = shift;
$self->{outfmt} = $$o{format};
}
sub initialize {
my $self = shift;
$self->SUPER::initialize (@_);
}
1;
Platon Group <platon@platon.sk> http://platon.sk/
|