Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks:
I am using Benchmark to do some simple tests, for example:
#!/usr/bin/env perl use strict; use warnings; use Benchmark qw[cmpthese timethese]; my @A = qw[this that these those]; my $result = timethese( -5, { test => sub { print @A }, with_for => sub { print for @A }, with_join=> sub { print join '', @A }, }); cmpthese($result); __END__
Problems is that the test functions contain print statement which clogged up my screen when the script is running. Is there some ways to silence these outputs??
Many thanks Lihao
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Question with Benchmark.pm
by moritz (Cardinal) on Dec 13, 2007 at 08:03 UTC | |
|
Re: Question with Benchmark.pm
by poolpi (Hermit) on Dec 13, 2007 at 15:13 UTC | |
by lihao (Monk) on Dec 13, 2007 at 21:04 UTC | |
|
Re: Question with Benchmark.pm
by KurtSchwind (Chaplain) on Dec 13, 2007 at 13:56 UTC | |
by chromatic (Archbishop) on Dec 13, 2007 at 19:13 UTC |