#!/usr/bin/perl -w
use strict;
BEGIN {
use Guard;
use Carp;
{
my $guard = guard { Carp::cluck "Function replaced!" };
my $code = \&time;
*time = sub { return $code->(@_); undef $guard; };
};
};
BEGIN { print time(), "\n"; };
use Time::HiRes qw(time);
print time, "\n";
I welcome critique on this one. In reply to Find out who redefined a subroutine by Dallaylaen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |