Ahh Thanks John !! it works now.
On 9/12/06, John W. Krahn <[EMAIL PROTECTED]> wrote:
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>
-- Best Regards, Leslie Joshua Wang +============================================================+ "I believe there's a hero in everyone of us, give us strength, make us noble, even though sometimes, we have to give up the things we want the most." +============================================================+ "The good thing about standard, there are so many of them to chose from ..." availability, performance and cost - pick 2 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>