Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Problem using Test::Simple

by beable (Friar)
on Jul 22, 2004 at 11:06 UTC ( [id://376537]=note: print w/replies, xml ) Need Help??


in reply to Problem using Test::Simple

It looks to me like it does "work". You'd have to say what you were expecting, and how the output differs from what you wanted to see.

The first warning about "main::a" being used only once, is because in the first subroutine you have the line $a=9; but $a is never used again. This is a standard Perl warning, because using a variable only once is often a sign of a typo, in that you spelled a variable name wrong. If you put use warnings; use strict at the start of your program, it will greatly reduce errors from this.

As for the warnings about "too few iterations", if you look at the documentation for Test::Benchmark, you'll see that the first argument to is_faster is the number of times to run each sub. Once is clearly not enough iterations to determine which is faster. Secondly, it is rather pointless to be timing code which is waiting on user input. If you type quickly for "enter a name" and type slowly for "give input", your test will pass, and vice-versa.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://376537]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2024-04-25 11:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found