Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: backticks in CGI

by synapse0 (Pilgrim)
on Jul 13, 2001 at 09:38 UTC ( [id://96293]=note: print w/replies, xml ) Need Help??


in reply to trouble populating array with input from a file

The program should die properly if failed to open (unless the pipe fools the call into thinking it went through ok).. but permissions are definitely a factor. Most servers run as "nobody", so you need to make sure that group and other have the permissions you need.
also, for troubleshooting, you can try:
while(<TMP>) { ($receiver,$uptime) = split; if ($DEBUG == 'TRUE') { # test split values, make sure you've # printed a header already print "testing: reciever = $reciever : uptime = $uptime<BR>"; } push @dataset, $uptime; push @labels, $receiver; }
that way you can see what it's doing as it's running..
remember to print out the vars as it's working if you're not getting what you think you should be..
-Syn0

Update: Thinking about the whole user issue, it may be that server user (probably nobody) may not be have access to obtain the information from uptime.pl (it may be able to run the script, but not get the data..)
just another thought..

Replies are listed 'Best First'.
Re: Re: backticks in CGI
by lestrrat (Deacon) on Jul 13, 2001 at 09:59 UTC

    For maderman 's particular problem, I don't think your "debug" print out would tell him anything useful.

    I think I would do

    my $output = `uptime.pl`; # or qx/ / print $output

    or

    my $exit_status = system( "uptime.pl" ); print $exit_status;

    first to make that the uptime.pl script is in fact running

      well.. @lables is being populated, so it looks like the file is being run.. the problem seems to be with the split.. so my method is check what return values from split are...it's just a debugging method to see what's coming from the split.. one step closer to getting it to run..
      -Syn0
Re: Re: backticks in CGI
by Anonymous Monk on Jul 13, 2001 at 11:12 UTC
    I don't think this is the case: If the main script is getting the @labels array okay, then it should also get @dataset.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://96293]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (5)
As of 2024-04-24 12:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found