Wow,  Thanks to all who responded.  I will check each of these items out.
The one thing I definitely was doing wrong is saving as CGI script.  I
resorted to that *after* I couldn't get the text version to work through
BBEdit.

I'm still doing something wrong though.  Here's what I changed:

Back to BBEdit & changed to saving as UNIX.  However, when I looked at "show
invisibles", it clearly showed the returns.  What do I do??
Does anyone else use BBEdit to write perl?
Should I use MacPerl?  If I use MacPerl, where do I set the lines for UNIX
machine?

To answer a few questions:
The hosting site is indeed a UNIX machine.

> Another thing to think about is newline format.
> 
> BBEdit will save your file with macintosh newlines, unless you specifically
> tell it not to.  Newer version of pico quietly discard PC/Mac newlines as
> you open a file, so I bet that's what happened.  The ISP guy opened your
> Mac formatted text script in pico, saved it, and it worked - only because
> it was then converted to unix newlines.

Hmmm...well I bet that's what happened too.  The thing I'm trying to figure
out is *HOW* do I do this?  <sigh>  In BBEdit there's option for UNIX lines.
There's also a choice of "None, MPW Shell, BBEdit", and another option for
"Encode as Unicode".  I don't know what these mean & what should be
selected, other than the UNIX lines.  Help!


> The first mistake I made when moving off the Mac was to leave off the initial
> solidus in
> $!/usr/bin/perl
> Full path names on the Mac don't start with a colon!

Well, mine is #!/usr/local/bin/perl
Is it supposed to be a $?  I thought it started with #?


> What is the script you are trying to use and what errors do you receive?

I'm using a script from this online course I'm taking.  Here it is:

--------

#!/usr/local/bin/perl

print "Content-type: text/html", "\n\n";

print "<HTML>\n<HEAD>\n<TITLE>The Daily Misleader</TITLE>\n</HEAD>\n";
print "<BODY>\n<H1>The Daily Misleader</H1>\n<BLOCKQUOTE>\n";

$first_line = 1;
$story = $ENV{'PATH_TRANSLATED'};
if ($story =~ /\.\./) {
  print ("<P>Paths that include .. are a security risk.</P> \n");
}
else {
  if (open (INPUT, "< $story")) {
    while (<INPUT>) {
      chop;
      if ($first_line) {
        print "<H1>", $_, "</H1>\n";
        $first_line=0;
      }
      elsif ($_ eq "") {
        print "<P>\n";
      }
      else {
        print $_, "\n";
      }
    }
  }
  else {
    print "<P>Couldn't open the requested file. </P>\n";
  }
}

print "<HR WIDTH=70%>\n";
print "<P>Back to the <A HREF=\"home.html\">home page</A>.</P>\n";
print "<P>CopyrightŠ 1997, Daily Misleader news service.</P>\n"


---------

I also have a .txt file to use with it.  I don't know exactly what the
problem is.

Thanks again everyone.  Hopefully I'll figure out what I'm doing wrong.




Reply via email to