Sub::Remove - Remove a subroutine from the symbol table and its associated CODE glob
use Sub::Remove qw(sub_remove); # In a different class sub_remove('sub_name', 'My::Class); # In main sub_remove('sub_name');
Removes a subroutine (function or method) from the namespace.
Removes a sub and all traces to it.
Parameters:
$sub_name
Mandatory, String: The name of the subroutine to remove.
$class
Optional, String: The name of the class to remove the symbol from. Defaults to main if not sent in.
main
Returns: True (1) upon success.
1
Steve Bertrand, <steveb at cpan.org>
<steveb at cpan.org>
Copyright 2022 Steve Bertrand.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
http://www.perlfoundation.org/artistic_license_2_0
To install Sub::Remove, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Sub::Remove
CPAN shell
perl -MCPAN -e shell install Sub::Remove
For more information on module installation, please visit the detailed CPAN module installation guide.