in reply to Testing Input and Output

I don't know _anything_ about the composition of a perl module or how to develop tests therefore, but perhaps you can use this:

Ever tried redirecting a child stdin or stdout with open()?

open( HANDLE, "ls -l |" ) or die "Unable to exec 'ls'\n";
while( <HANDLE> ) {
#Process each line of output '$_'
}
close( HANDLE );

I do this all the time when I want to execute a child process and evaluate it's output.

HTH,
James

Replies are listed 'Best First'.
Re: Re: Testing Input and Output
by grep (Monsignor) on Sep 02, 2002 at 07:02 UTC

    I do this all the time when I want to execute a child process and evaluate it's output.

    There is a cleaner (IMO) way to do this - the qx or backtick operator handles all that work for you.

    #!/usr/bin/perl -w my @files = qx/ls -l/; ##### or # my @files = `ls -l`; print for @files ;


    grep
    Mynd you, mønk bites Kan be pretti nasti...