Code Help

Posted by: Dignan

Code Help - 27/09/2002 11:57

An organization I belong to once had a nice little bulletin board attached to our site. We've moved around and now, for some reason, it's stopped working.

Rather than try to find something somewhere that will replace it (I've tried, and there's nothing of the sort), I would like to try to fix it.

It was written by one of our members and is nice and simple and doesn't require a database or anything. I tried loading it into Dreamweaver, and it only had one problem with the code in several places. I'll attach a picture of that in another post.

I have provided the code here in hopes that someone here will help me. It would be greatly appreciated. Thanks in advance for anything you can tell me.
Posted by: Dignan

Re: Code Help - 27/09/2002 11:58

Here's an example of the problem that Dreamweaver had with it:

Posted by: jaharkes

Re: Code Help - 27/09/2002 12:17

I'm not a perl guy, but what is dreamweaver and why does it use some [censored] up HTML parser? It looks like it tries to turn some of your perl code into stupid <HTML> tags.

Maybe if you use print<<EOF; ..... EOF
Posted by: wfaulk

Re: Code Help - 27/09/2002 12:26

What your program is doing here is using the ``<<HTML'' here-doc syntax to print out the stuff between that line and the succeeding ``HTML''. (Read the perlop man page and search for ``here-document''.) Dreamweaver, with which I am totally unfamiliar, is getting confused because it looks like an HTML tag, which it's not. Did Dreamweaver change the angle-bracket that's supposed to be starting the CENTER tag to the other polarity? If so, change it back. If not, change it back anyway. Is Dreamweaver supposed to understand perl? If so, it's doing a bad job.

Possible workaround #1: Change the surrounding HTML tags to EOF instead. Maybe that will confuse Dreamweaver less.

Possible workaround #2: Change the here-doc to quotes.

Let us know if any of that needs further explanation.
Posted by: mtempsch

Re: Code Help - 27/09/2002 12:32

print<<HTML;
the
following lines
HTML;

means print "the following lines", as formatted, to stdout, until we find a line that has HTML; alone on it. If you want to check out the code (perl stuff) you'd probably be better off with an editor that has a better understanding of perl than HTML.

Check that perl finds all modules that are used. If the -w flag is not given, add it while debugging.

Edit: Late as usual Good suggestions!

/Michael
Posted by: wfaulk

Re: Code Help - 27/09/2002 12:40

In looking for info as to whether Dreamweaver could understand perl (I don't believe it does), I found this snippet of text on their web site:
to allow for sophisticated visualization and editing/td>
(emphasis mine)

I can't say I'm likely to run out and buy it if this is an example of how well it works.
Posted by: Dignan

Re: Code Help - 27/09/2002 12:57

Hmm, okay, that all makes sense. I wasn't positive that it could figure out PERL so that would explain that part. But Dreamweaver had nothing to do with the problem, I was merely opening it in the program to see if it could handle the scripts. Obviously it can't

I believe that the code I attached to my first post is Dreamweaver-less. If anyone here is familiar with PERL, they'd be my eternal idol if they could help me figure out what is wrong, or how I should go about setting it up on my organization's site.

Thanks for all the suggestions so far, though. You guys are awesome.
Posted by: wfaulk

Re: Code Help - 27/09/2002 13:05

Run it on the command line. What does it say?
Posted by: mtempsch

Re: Code Help - 27/09/2002 13:12

Do you get any error messages?

As I said before, try adding the ' -w' flag to the very first line (#!/usr/bin/perl).

Check that you have the CGI.pm module installed and in a location found by perl.

Which perl version do you have currently, and if you know, which version did the last functioning installation have?

/Michael