"...I was suggested to use a role for this...
Not a bad idea. Why don't you give it a try?
For further inspiration you may probably read this:
See also:
Best regards, Karl
P.S.: Little addendum: Years ago i wrote this little sketch for Lady_Aleena to illustrate what was my idea/understanding of a plugin:
package MyClass; use Class::Tiny qw(something); use Role::Tiny::With; use feature qw(say); say q(package ) . __PACKAGE__; with qw(MyRole); 1; package MyRole; use Role::Tiny; use feature qw(say); requires qw(something); say q(package ) . __PACKAGE__; around 'something' => sub { print q(Long John Silver said ); uc &{ (shift) }; }; 1; #!/usr/bin/env perl use strict; use warnings; use MyClass; use feature qw(say); say q(package ) . __PACKAGE__; my $object = MyClass->new( something => q("I reckon i settled you.") ) +; say $object->something; __END__
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
In reply to Re: Modules design pattern: abstraction vs incarnation (providing not so static data)
by karlgoethebier
in thread Modules design pattern: abstraction vs incarnation (providing not so static data)
by Discipulus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |