Sub::Prototype - Set a sub's prototype
Contents
Contributor
Karen Etheridge <ether@cpan.org>
Copyright And Licence
This software is copyright (c) 2008 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5
programming language system itself.
perl v5.40.0 2024-10-20 Sub::Prototype(3pm)
Functions
This module only has one function, which is also exported by default:
set_prototype(\&coderef,$prototype)
set_prototype(\&some_function, '$$');
Sets the prototype for "coderef" to $prototype.
Name
Sub::Prototype - Set a sub's prototype
Support
Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=Sub-
Prototype> (or bug-Sub-Prototype@rt.cpan.org <mailto:bug-Sub-Prototype@rt.cpan.org>).
Synopsis
use Sub::Prototype;
BEGIN {
my $code = sub { ... };
set_prototype($code, '&@');
*main::my_func = $code;
}
my_func { ... } @list;
Thanks
Shawn M Moore for the idea and tests.
Version
version 0.03
