Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > perl script at godaddy

Reply
Thread Tools

perl script at godaddy

 
 
cgidatabase@yahoo.com
Guest
Posts: n/a
 
      03-28-2005
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);

 
Reply With Quote
 
 
 
 
Brian McCauley
Guest
Posts: n/a
 
      03-28-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:

> 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.

 
Reply With Quote
 
 
 
 
axel@white-eagle.invalid.uk
Guest
Posts: n/a
 
      03-29-2005
(E-Mail Removed) wrote:
> This script works on another server ok but doesn't at godaddy.


If it does, it shouldn't.

> print TEMPFILE "$in{'email'}<br>"$in{'message'}<hr>\n\n";

^^^

Axel

 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      03-31-2005
(E-Mail Removed) wrote:
> 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.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
cgidatabase@yahoo.com
Guest
Posts: n/a
 
      04-01-2005
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.

Gunnar Hjalmarsson wrote:
> (E-Mail Removed) wrote:
> > 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.
>
> --
> Gunnar Hjalmarsson
> Email: http://www.gunnar.cc/cgi-bin/contact.pl


 
Reply With Quote
 
Gunnar Hjalmarsson
Guest
Posts: n/a
 
      04-01-2005
(E-Mail Removed) wrote:
> Gunnar Hjalmarsson wrote:
>> 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.

>
> 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

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
godaddy & perl grouchy.oldgit@googlemail.com Perl Misc 6 03-30-2009 06:56 AM
GoDaddy script problems, Dave! jp2code ASP General 1 09-24-2007 03:47 PM
problem calling perl script from SOAP server perl script pj Perl Misc 3 04-09-2004 10:23 PM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM
How to make Perl Script "POST" call from another Perl Script??? Wet Basement Perl 1 07-15-2003 10:25 PM



Advertisments