in reply to Interactive prompts inside a test harness

You should really be using one of the Term::Readline::* modules to be prompting for the password rather than the stty which isn't installed or readily useable on all operating systems. Moreover, it's the most error-prone executable perl can call in my experience. As for authentication on the server and recieving a return value, no info has been given on the particulars, so we'll just have to presume that a value representing TRUE is returned on a successful login and FALSE otherwise
my $status = authenticate($username, $password); if ($status) { #if authenticate() returned a 'TRUE' value # get the test string from somewhere # and then use it in the following test my $is_like = Test::More->like( get_string(), qw/like_regex/, $test_name); }

Replies are listed 'Best First'.
Re^2: Interactive prompts inside a test harness
by jkeenan1 (Deacon) on Nov 08, 2006 at 02:04 UTC
    Firefly258 wrote:

    You should really be using one of the Term::Readline::* modules to be prompting for the password ...

    I was shying away from Term::ReadLine at first because it wasn't core, and I don't want to have to include non-core modules in this tarball for my code to work. But just now I typed:

    corelist Term::ReadLine

    ... and discovered:

    Term::ReadLine was first released with perl 5.002

    ... so I'll definitely be making use of it. Thank you very much.

    UPDATE:

    Wait! Perhaps I won't be making use of it after all. It's non-core module Term::ReadKey that you use to turn off echoing -- not Term::ReadLine. Correct?

    Jim Keenan