in reply to RFC: Devel::Deprecate

This is a nice reminder system with real teeth. It's a good idea as is. If you wanted, you could even generalize this to be a phased update system to introduce changes on a given date as well.

Replies are listed 'Best First'.
Re^2: RFC: Devel::Deprecate
by Ovid (Cardinal) on Apr 23, 2008 at 16:38 UTC

    I thought about an update system, but realized that I'd be introducing a complication that might not be appropriate. Going with dragonchild's recommendation of making the 'if' key point to a subroutine and you could hook in anything you wanted. Suggestions still welcome, though.

    I think possibly that if we hit the 'die' date, maybe it should warn if the condition is not triggered. That way developers would know to remove the code or update their dates.

    Cheers,
    Ovid

    New address of my CGI Course.

      Well, I'm not sure how to name them, but if you had an unlimited number of dates and each date could be assigned its own sub, you could make it extremely flexible. Perhaps an unlimited number, but with certain names reserved would work.

      phased_update( { intro => [ "2008.06.01", sub {} ], # not reserved foo => [ "2008.08.01", sub {} ], # not reserved deprecate => [ "2008.12.31", sub {} ], # reserved dead => [ "2010.01.01", sub {} ], # reserved } );

      The exact syntax might need some work, but you get the idea. The reserved values could trigger default actions if there's no sub.