in reply to use deprecated;

Nice idea.

I see one problem with it: you need to change the source of each of the OldeCruft modules. Or install a code reference in @INC that does its magic as a source filter on all modules loaded.

A solution in which you would just add -Mdeprecated to the command line, would be nicer, I think.

One way to do this, would be to put all the knowledge about OldeCruft modules in the "deprecated" module and have that check at INIT {} or CHECK {} time. A concept:

package deprecated; INIT { die "Cannot use OldeCruft\n" if defined $OldeCruft::VERSION; # possibly install wrappers also here }
This however has the disadvantage that this won't work under mod_perl (as INIT and CHECK dont't work with mod_perl).

Hope this helps.

Liz

Replies are listed 'Best First'.
Re: Re: use deprecated;
by halley (Prior) on Nov 26, 2003 at 15:16 UTC
    Two comments.

    As the company librarian, I can edit the official copy of OldeCruft.pm, but I don't know how many thousands of old private scripts may be depending on it. So I wanted to be able to add one line to OldeCruft.pm and thus all other scripts would start carping automatically. I can't just email the developers to say "add this weird -Mdeprecated thing..."

    I want deprecated to be agnostic; it doesn't care who uses it, it doesn't know which modules are deprecated. By including this pragma, you mark the module as deprecated, and that's all you need to know. Modules come and modules go, and I'm not interested in editing some custom and touchy intelligence in the 'deprecated' module every month.

    --
    [ e d @ h a l l e y . c c ]