ubergoonz wrote:
> I am trying to creat a CGI page that display the ordernumber of the
> yppoll output on all my NIS servers, using the following
> my $svr_order = `yppoll $nissvr $map | grep order| awk '{print $NF}'`;
> 
> but it just seems to be empty.
> 
> any idea how can I fix this?

It is probably an interpolation problem as that string is interpolated by both
perl and the shell.  Try it like this:


open my $pipe, '-|', 'yppoll', $nissvr, $map
    or die "Cannot open pipe from 'yppoll' $!";

while ( <$pipe> ) {
    print +( split )[ -1 ] if /order/;
    }

close $pipe or warn $! ? "Error closing 'yppoll' pipe: $!"
                       : "Exit status $? from 'yppoll'";



John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to