perl script at godaddy

Discussion in 'Perl Misc' started by cgidatabase@yahoo.com, Mar 28, 2005.

  1. Guest

    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);
     
    , Mar 28, 2005
    #1
    1. Advertising

  2. 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.
     
    Brian McCauley, Mar 28, 2005
    #2
    1. Advertising

  3. Guest

    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
     
    , Mar 29, 2005
    #3
  4. 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
     
    Gunnar Hjalmarsson, Mar 31, 2005
    #4
  5. Guest

    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:
    > 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
     
    , Apr 1, 2005
    #5
  6. 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
     
    Gunnar Hjalmarsson, Apr 1, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dpackwood
    Replies:
    3
    Views:
    1,824
  2. d2005\\

    HttpWebRequest on GoDaddy Problem

    d2005\\, May 15, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    651
    Joerg Jooss
    May 18, 2005
  3. RepAlciere

    GoDaddy closes case.

    RepAlciere, Dec 30, 2003, in forum: HTML
    Replies:
    5
    Views:
    440
    Matthew Superstar Swass
    Dec 31, 2003
  4. jp2code

    GoDaddy script problems, Dave!

    jp2code, Sep 13, 2007, in forum: ASP General
    Replies:
    1
    Views:
    231
    jp2code
    Sep 24, 2007
  5. godaddy & perl

    , Mar 29, 2009, in forum: Perl Misc
    Replies:
    6
    Views:
    285
    brian d foy
    Mar 30, 2009
Loading...

Share This Page