diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-07 18:14:41 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-07 18:14:41 +0000 |
commit | f695f0e6874001cf0696a1b1ec3411efe80ba2a9 (patch) | |
tree | 63b751f0277abe85a3109f4e9aaa32e19eb66112 /lib/Benchmark.pm | |
parent | 71a0fcfa4f595293e734533885433c47a0d65f10 (diff) | |
download | perl-f695f0e6874001cf0696a1b1ec3411efe80ba2a9.tar.gz |
The #20546 was too ambitious, broke the test.
p4raw-id: //depot/perl@20556
Diffstat (limited to 'lib/Benchmark.pm')
-rw-r--r-- | lib/Benchmark.pm | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/lib/Benchmark.pm b/lib/Benchmark.pm index 0ca7c59e4f..c472d58ffd 100644 --- a/lib/Benchmark.pm +++ b/lib/Benchmark.pm @@ -485,19 +485,39 @@ sub usage { # The cache needs two branches: 's' for strings and 'c' for code. The # empty loop is different in these two cases. -sub clearcache ($) { +$_Usage{clearcache} = <<'USAGE'; +usage: clearcache($count); +USAGE + +sub clearcache { + die usage unless @_ == 1; delete $Cache{"$_[0]c"}; delete $Cache{"$_[0]s"}; } -sub clearallcache () { +$_Usage{clearallcache} = <<'USAGE'; +usage: clearallcache(); +USAGE + +sub clearallcache { + die usage if @_; %Cache = (); } -sub enablecache () { +$_Usage{enablecache} = <<'USAGE'; +usage: enablecache(); +USAGE + +sub enablecache { + die usage if @_; $Do_Cache = 1; } -sub disablecache () { +$_Usage{disablecache} = <<'USAGE'; +usage: disablecache(); +USAGE + +sub disablecache { + die usage if @_; $Do_Cache = 0; } |