in reply to Replacing a Subroutine at Runtime

Very intersting. Please excuse this question if it reveals my ignorance, but what does the following line mean? undef &{ *my_sub{CODE} };

Replies are listed 'Best First'.
RE: RE: Replacing a Subroutine at Runtime
by btrott (Parson) on Mar 25, 2000 at 01:03 UTC
    It undefines the subroutine that was previously defined as my_sub. It does so by getting the CODE ref part of the "my_sub" typeglob, then undefining the subroutine that that code ref references.

    Since the goal of this is to replace that subroutine, this prevents the warning you would otherwise get (when you have warnings enabled) that "subroutine SUB has been redefined".