in reply to can undefined methods?

Looks like a bug to me, though I'm not sure that undefining a subroutine is a valid thing to do.

I just tested it in 5.00504, 5.8.4 and 5.8.5 and they all give that result.

It's been mentioned on p5p: summary / start of thread

update: it appears you can delete $::{'foo'} to completely remove a subroutine. The difference with undef &foo being that delete removes the sub's name from the symbol table, while undef doesn't.

Replies are listed 'Best First'.
Re^2: can undefined methods?
by Dave Howorth (Scribe) on Nov 29, 2004 at 15:02 UTC
    Thanks for that Joost, it solved my problem.

    It's definitely OK to undef a subroutine, according to Prog. Perl anyway.

    To give another key point from the thread not included in the summary, 'can' behaves the way it does so that it can be useful in the presence of AUTOLOAD, but the docs could be improved.