in reply to How to stack a call to a class method
my $clone_warn = \&warnings::warn; *warnings::warn = sub { print "Look ma!\n"; $clone_warn->(some_filter_function_i_provide @_); };
Just take a reference to whatever it was you want to keep..
Update: clone_warn(foo) was an overlooked copypaste remnant.. It is a scalar holding a coderef of course.
Makeshifts last the longest.
|
|---|