Is it possible to pass variables between multiple calls in around MethodModier ? example (this does not work, but hopefully conveys what I want)
sub mysub { ... };
around 'mysub' => sub {
my $orig = shift;
my $self = shift;
my $value = get_value;
$self->orig(@_);
};
around 'mysub' => sub {
my $orig = shift;
my $self = shift;
my $value = shift;
my $output
= "sometext $value"
. $self->orig(@_);
. 'someothertext $value'
;
};
In the end, I wanted these "circles" to be placed in plug-in lines, where I do not know which ones were loaded in advance, but the final output will be neatly formatted.
Perhaps I think about it completely wrong, so welcome other suggestions.
source
share