NAME

Sub::Delete - Perl module enabling one to delete subroutines

VERSION

0.02 (beta)

SYNOPSIS

use Sub::Delete;
sub foo {}
delete_sub 'foo';
eval 'foo();1' or die; # dies

DESCRIPTION

This module provides one function, delete_sub, that deletes the subroutine whose name is passed to it. (To load the module without importing the function, write use Sub::Delete();.)

This does more than simply undefine the subroutine in the manner of undef &foo, which leaves a stub that can trigger AUTOLOAD (and, consequently, won't work for deleting methods). The subroutine is completely obliterated from the symbol table (though there may be references to it elsewhere, including in compiled code).

PREREQUISITES

This module requires perl 5.8.3 or higher.

BUGS

If you find any bugs, please report them to the author via e-mail.

AUTHOR & COPYRIGHT

Copyright (C) 2008 Father Chrysostomos (sprout at, um, cpan dot org)

This program is free software; you may redistribute or modify it (or both) under the same terms as perl.

SEE ALSO

perltodo, which has delete &sub listed as a possible future feature