# Error checking omitted for brevity... package Foo::Transform; my %transformations = ( # TODO - What goes here? ); sub new { my ($proto, @xforms) = @_; my $class = ref($proto) || $proto; bless({ xforms => [ @xforms ] }, $class); } sub transform { my ($self, $container) = @_; for my $xform (@{$self->{xforms}}) { my $foo = get_foo(); my $bar = get_bar(); # TODO - Apply transformation named $xform # on $container, with $foo and $bar # available as well. } }