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=("Iotta::Format::In::".$infmt)->new; #FIXME $fo=("Iotta::Format::Out::".$s->outfmt)->new; $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;