Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^2: Using Sub::Override

by TStanley (Canon)
on Jun 19, 2007 at 02:16 UTC ( #621914=note: print w/replies, xml ) Need Help??

in reply to Re: Using Sub::Override
in thread Using Sub::Override

No. The out function is what actually prints the question to STDOUT. The in function is what reads the answer. $line is a variable inside the test function of Games::QuizTaker. For each question in the test, it loops through an array, putting each element into the $line variable and prints it out.

People sleep peaceably in their beds at night only because rough men stand ready to do violence on their behalf. -- George Orwell

Replies are listed 'Best First'.
Re^3: Using Sub::Override
by chromatic (Archbishop) on Jun 19, 2007 at 06:22 UTC

    I don't have enough information to help you then. Your code has baffled me; I have no idea why you would override out() to return a variable when you call it in void context, and I can't see what you would get from not mocking in(), which presumably prompts for input. I never prompt for input in any of my automated tests.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://621914]
[shmem]: yes, at least for the result in @foo
[shmem]: but the results of both operations are different.
[shmem]: result := the discarded result (what's leftmost of the statement)
[shmem]: push returns the number of elements in @foo, the assignment returns all the elements in the (renewed) @foo
[Lady_Aleena]: Sanity check please? push @line, ref($list_addition ) eq 'ARRAY' ? @$list_addition : $list_addiction; # so I don't have the change existing uses of the sub.

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (7)
As of 2017-04-27 11:40 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (503 votes). Check out past polls.