perl script at godaddy

C

cgidatabase

I've been trying to get my perl program going at godaddy.
all I'm trying to do is open a file and read it and write to a file. It
seems to go through the motions witout errors but doesn't produce any
results.
This script works on another server ok but doesn't at godaddy.
i have emailed support and they want to charge for looking at my
script. i'm cheap i know but what i'm trying to do is not that
complicated. thanks for any help.
Tim

$afile = "../folder/afile.htm";

$tempfile = "../folder/temp1.htm";

open(FILB1,"$afile") || die "tryin FILE\n";
@data1 = <FILB1>;
close(FILB1);

open(TEMPFILE,">$tempfile") || die "trying tempfile\n";

foreach $d (@data1)
{
chop($d);
print TEMPFILE "$d\n";
if ($d =~ /<! -- BEGINNING -- >/i)
{
print TEMPFILE "$in{'email'}<br>"$in{'message'}<hr>\n\n";
}
}
close(TEMPFILE);
rename ("$afile", "$afile.old");
rename ("$tempfile", "$afile");
exit(0);
 
B

Brian McCauley

I've been trying to get my perl program going at godaddy.
all I'm trying to do is open a file and read it and write to a file. It
seems to go through the motions witout errors but doesn't produce any
results.

How do you reconcile "goes through the motions" and "doesn't produce any
results". It is impossible to infer that it is going through any
motions other than by observing results.

Anyhow it's impossible that it "doesn't produce any results". A blank
page is a result. A timeout is a result. Unless running your script
actually causes the passage time to cease there must be some result.
(Although arguably even that would be a result of sorts).
This script works on another server ok but doesn't at godaddy.
i have emailed support and they want to charge for looking at my
script.

Yeah, well it is hardly pleasant to look at is it?

No variable declarations.

No indentation.

A couple of race conditions.

Errors not included in the error messges.

Calls to an operating system fuction (rename()) without checking to see
if/why it failed.

Redundant quoting of string variables.

chop() where you probably meant chomp() but really shouldn't bother at all.

Forgets to escapeHTML when inserting plaintext into an HTML document.

It even looks like it may be using the nasty old cut-n-paste CGI request
parser.
 
G

Gunnar Hjalmarsson

thanks for the support. still not working. i have tried a simple script
in an effort to get at what's not working with it at godaddy.
#!/usr/bin/perl
require "cgi-lib.pl";
print "Content-Type: text/html\n\n";
print "hello world";
#end

the require statement seems to be the culprit.

It does sound plausible that the outdated cgi-lib.pl isn't available in
@INC. You *could* solve that by installing cgi-lib.pl in the same
directory as your script, but a better solution is to replace the line
with what's suggested in the "COMPATIBILITY WITH CGI-LIB.PL" section in
the POD for CGI.pm.
 
C

cgidatabase

yes the cgi-lib.pl is in my cgi directory.
there is also a gdform.cgi file that came with the cgi directory.
it has a parse_form_data routine but the require doesn't work for that
either. the chmod on gdform.cgi was set at 711.
on my other server all scripts are set at 744.
i have other routines saved in cgi-lib.pl that i would like to use.
does anyone have the particulars for a cgi bin at godaddy?
like what is the chmods. not to mention sendmail.
thanks.
 
G

Gunnar Hjalmarsson

yes the cgi-lib.pl is in my cgi directory.

Okay. How about start using CGI.pm instead by changing two lines in your
script? (See above.)
there is also a gdform.cgi file that came with the cgi directory.
it has a parse_form_data routine but the require doesn't work for that
either. the chmod on gdform.cgi was set at 711.
on my other server all scripts are set at 744.

The most commonly used permission settings for CGI scripts is 755.

For some general advice on CGI scripts, you may find this URL useful:
http://my.execpc.com/~keithp/bdlogcgi.htm
i have other routines saved in cgi-lib.pl that i would like to use.
does anyone have the particulars for a cgi bin at godaddy?
like what is the chmods. not to mention sendmail.

This is not the place for such questions. Consult the docs or ask the
support.

/ Gunnar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,906
Latest member
SkinfixSkintag

Latest Threads

Top