in reply to feeling rather stagnant ...
For example if your glue code is just delegating method calls to some other object you could transform
intopackage Foo; sub method1 { my $self = shift; my $object = $self->{object}; $object->method1(@_); } sub method2 { my $self = shift; my $object = $self->{object}; $object->method2(@_); } sub method3 { my $self = shift; my $object = $self->{otherobject}; $object->method3(@_); }
package Foo; use My::Delegator qw( method1 => "object", method2 => "object" method3 => "otherobject" );
There are lots of other repetitive coding tasks that can be automated once you know how Perl deals with methods, code references and all that.
One thing is that Perl isn't perfectly suited to automated coding, something like lisp is and you can essentially produce what seems like magical result with lisp macros. So maybe your particular form of repetitive coding is not easily eliminated with Perl.
|
|---|