OK..
I had figured some things out since all the responses (thanks).
I found that if I ran it from command line, I only received a partial out
put and knew that the counter.cgi script ran but failed half way.. after
alot of "print" statements showing me what's going on found that it stopped
because of a security issue and it wouldn't let anything but the URL run the
script.
I have adjusted it so localhost can run it and now works from command line
displaying below as the output.
<img src="blahblaimage.gif">
But in the signup.cgi it gets nothing at all even though it should have
run???????? $count has a NULL value...
Is there any easier way of debugging Perl scripts? Modifying the script and
putting a few print statements is a bit of a pain.. espcially when the
server is a remote server and slow..
-----Original Message-----
From: Grant Parnell [mailto:[EMAIL PROTECTED]]
Sent: Sunday, June 18, 2000 10:11 AM
To: [EMAIL PROTECTED]
Cc: George Vieira
Subject: [SLUG] Perl script help
> Date: Sat, 17 Jun 2000 14:46:58 +1000
> From: George Vieira <[EMAIL PROTECTED]>
> Subject: [SLUG] Perl script help
>
> Hi all,
>
> I'm fiddling with a perl script (signup.cgi) which I require to call
another
> script (counter.cgi).
> I am not a Perl programmer and I am not sure how to call another CGI
within
> one.
> I tried using a variable to retrieve the output of the counter.cgi and
then
> display further down the script but I get gooberish.
>
> This is a snippet of what I have got at the moment... (warning alot of
> playing around done here)
>
> (signup.cgi)
> - ------------------
> require("/home/httpd/cgi-bin/cgi-lib.pl") || die "require cgi-lib.pl
died";
> $count=("/home/httpd/cgi-bin/counter.cgi domain=www.mydomain.com.au
> page=sign
> up visible=true")
>
> print "We have had $count visits to this page.";
> - ------------------
Not sure if this has been explained already but...
$count=`/home/httpd/cgi-bin/counter.cgi domain=www.mydomain.com.au`
This is just like in shell, the backticks are used to get the output
rather than the other quotes.
It's also worth running the counter.cgi from the shell to see what it
outputs.
$ cd /home/httpd/cgi-bin
$ counter.cgi domain=www.mydomain.com.au
You might find that what counter.cgi returns is in fact an image and
not text at all?? I forget the syntax but you might need something in
the vein of this...
print "We have had <inline img>$count</inline> visitors";
---<GRiP>---
Grant Parnell [EMAIL PROTECTED] ([EMAIL PROTECTED])
Ph: 02-8701-4564 Mob: 0408-686-201 Web: http://www.poboxes.com/gripz
No Microsoft products were used in the production of this message.
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text