Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Trouble Using "Top" Within Perl

by kschwab (Priest)
on Sep 14, 2002 at 15:13 UTC ( #197871=note: print w/replies, xml ) Need Help??


in reply to Trouble Using "Top" Within Perl

You could check the $? variable after the backtick call. My best guess is that rsh is in /usr/sbin, which isn't in the PATH environment variable in your CGI environment.

Another idea would be to capture stderr:

@top=`rsh $node top -n 1 -b 2>&1`;
Then you might catch what the shell and/or rsh is unhappy about.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://197871]
help
Chatterbox?
[Corion]: When you pass an arrayref, you get to treat it like a local array. But then, I'm cautious with the experimental features, because just when I thought function signatures were a set thing, there is a proposal to use sub [ $foo, $bar ] { ... } to ...
[Corion]: ... declare the parameters, instead of the more common sub ($foo, $bar) { ... }

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2017-11-17 20:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (272 votes). Check out past polls.

    Notices?