#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    2
    Rep Power
    0
    i have written some cgis which i know run on a windows based apache server, but am having trouble getting them to run on a unix server. i have "unix-ized" them, via WinEdit, and chmodded them to the required 755 on the server. i telnetted in and got the p(resent) w(orking) d(irectory), so the paths should be okay...operative word there, "should"...can't see any obvious errors in perl syntax, but know that unix and windows are two different "camels" (you should pardon the o'reilly pun). anybody have any ideas?
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    7
    Rep Power
    0
    Pls post some examples. What exactly is not working ?
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    2
    Rep Power
    0
    Here's a sample one that DOES work on the unix server:

    #! /usr/local/bin/perl
    use CGI qw(param);

    Content-type: text/plainnn;

    print <<End_of_Multiple_Lines;

    <html>
    <head>
    <title>Test</title>
    <body>
    <h1><font size="3">Hello World</font></h1>
    </body>
    </html>

    End_of_Multiple_Lines

    Here's a sample of one that DOESN'T work:

    #! /usr/local/bin/perl

    use CGI qw(:standard);

    $name = param("ename");
    $to = param("eaddress");
    $cc = "anyone@anywhere.com";
    $sendlet = param("echeck");
    $subject = param("einterest");
    $from = "LetterMan@anywhere.com";
    #$body = param("etext");
    $mailfile = "/www/htdocs/domainname/mailtemp/";
    open(OUTFILE,">$mailfile");
    print OUTFILE "TO: ",$name,"<",$to,">n";
    print OUTFILE "FROM: ",$from,"n";
    print OUTFILE "CC: ",$cc,"n";
    print OUTFILE "SUBJECT: ",$subject,"n";
    print OUTFILE "n";
    print OUTFILE "Thank you for your interest in Anywhere.com. A company representative will review your email request and get back to you in a timely manner.n";
    if ($sendlet ne "")
    {
    print OUTFILE "We have added your email address to our list of subscribers";
    open (NEWOUT,">>/www/htdocs/domainname/efile.txt/");
    print NEWOUT "$namet$ton";
    close (NEWOUT);
    }
    close(OUTFILE);
    @args = ("/usr/sbin/sendmail","-t",'-messagefile="/www/htdocs/domainname/mailtemp/"');
    print "Location: /www/htdocs/domainname/response.htmnn";

    the names have been changed to protect the innocent...client, that is! the error message the server sends back is that the page cannot be viewed. any ideas?

Similar Threads

  1. SSI and Perl on IIS5
    By Donboy in forum IIS
    Replies: 9
    Last Post: November 5th, 2004, 07:49 AM
  2. Replies: 4
    Last Post: April 23rd, 2004, 11:18 AM
  3. Unix Commands in a Perl Script?
    By brawta in forum Perl Programming
    Replies: 3
    Last Post: January 14th, 2004, 11:31 PM
  4. Running Perl script between Unix and Windows
    By wscici in forum Perl Programming
    Replies: 0
    Last Post: October 5th, 2003, 09:26 PM
  5. unix perl txt read/write error on windows iis5
    By help-me-pls in forum Perl Programming
    Replies: 7
    Last Post: September 14th, 2003, 05:37 PM

IMN logo majestic logo threadwatch logo seochat tools logo