Sub::WrapInType::Attribute - attribute for Sub::WrapInType
use Sub::WrapInType::Attribute;
use Types::Standard -types;
sub hello :WrapSub([Str] => Str) {
my $message = shift;
return "HELLO $message";
}
hello('world!!'); # => HELLO world!!
my $code = \&hello; # => Sub::WrapInType object
This module provides attribute for Sub::WrapInType, which makes it easier to check during the compilation phase.
The :WrapSub
code attribute performs Sub::WrapInType#wrap_sub
on the subroutine that specified this attribute.
The :WrapMethod
code attribute performs Sub::WrapInType#wrap_method
on the subroutine that specified this attribute.
Copyright (C) kfly8.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
kfly8 kfly@cpan.org