in reply to use deprecated;
That was nice food for thought.
It should be obvious what is happening here, if not just change the eval to a print.package deprecated; use constant EVAL_CODE => <<'END_CODE'; sub %1$s::INIT { my $overridden = \&%2$s; *%2$s = sub { require Carp; Carp::carp('%2$s() is deprecated'); *%2$s = $overridden; goto &$overridden; }; } END_CODE sub import { my $class = shift; my $pkg = caller; eval join '', map sprintf(EVAL_CODE, $pkg, "$pkg\::$_"), @_; } 1;
Makeshifts last the longest.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: use deprecated;
by adrianh (Chancellor) on Nov 26, 2003 at 23:55 UTC | |
by Aristotle (Chancellor) on Nov 28, 2003 at 01:18 UTC | |
by adrianh (Chancellor) on Dec 03, 2003 at 01:21 UTC |
In Section
Seekers of Perl Wisdom