that worked!
#!/usr/bin/env perl use strict; use warnings; my $total_sleep_time = 0; BEGIN { *CORE::GLOBAL::sleep = sub(;@) { $total_sleep_time+=$_[0]; CORE::sleep +($_[0]) } } # use this module and the other # ... print "\$]=$] \$^V=$^V\n"; sleep(2); print "total sleep is $total_sleep_time\n";
$]=5.026002 $^V=v5.26.2 total sleep is 2thanks
In reply to Re^2: Copy a builtin sub to a different name and then override
by bliako
in thread Copy a builtin sub to a different name and then override
by bliako
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |