Sub::Mutate - examination and modification of subroutines
use Sub::Metadata qw( sub_body_type sub_closure_role sub_is_lvalue sub_is_constant sub_is_method mutate_sub_is_method sub_is_debuggable mutate_sub_is_debuggable sub_prototype mutate_sub_prototype ); $type = sub_body_type($sub); $type = sub_closure_role($sub); if(sub_is_lvalue($sub)) { ... if(sub_is_constant($sub)) { ... if(sub_is_method($sub)) { ... mutate_sub_is_method($sub, 1); if(sub_is_debuggable($sub)) { ... mutate_sub_is_debuggable($sub, 0); $proto = sub_prototype($sub); mutate_sub_prototype($sub, $proto); use Sub::WhenBodied qw(when_sub_bodied); when_sub_bodied($sub, sub { mutate_sub_foo($_[0], ...) });
This module is a backward-compatibility wrapper repackaging functions that are now supplied by other modules. It is deprecated to use this module: you should instead get the functions directly from Sub::Metadata or Sub::WhenBodied as appropriate.
These functions are supplied by Sub::Metadata. You should use that module directly. See that module for documentation.
This function is supplied by Sub::WhenBodied. You should use that module directly. See that module for documentation.
Sub::Metadata, Sub::WhenBodied
Andrew Main (Zefram) <zefram@fysh.org>
Copyright (C) 2009, 2010, 2011, 2013, 2015 Andrew Main (Zefram) <zefram@fysh.org>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Sub::Mutate, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sub::Mutate
CPAN shell
perl -MCPAN -e shell install Sub::Mutate
For more information on module installation, please visit the detailed CPAN module installation guide.