Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#118202 - 27/09/2002 11:57 Code Help
Dignan
carpal tunnel

Registered: 08/03/2000
Posts: 12345
Loc: Sterling, VA
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.


Attachments
116682-board.txt (712 downloads)

_________________________
Matt

Top
#118203 - 27/09/2002 11:58 Re: Code Help [Re: Dignan]
Dignan
carpal tunnel

Registered: 08/03/2000
Posts: 12345
Loc: Sterling, VA
Here's an example of the problem that Dreamweaver had with it:



Attachments
116683-Image1.gif (68 downloads)

_________________________
Matt

Top
#118204 - 27/09/2002 12:17 Re: Code Help [Re: Dignan]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
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
_________________________
40GB - serial #40104051 gpsapp

Top
#118205 - 27/09/2002 12:26 Re: Code Help [Re: Dignan]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
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.
_________________________
Bitt Faulk

Top
#118206 - 27/09/2002 12:32 Re: Code Help [Re: Dignan]
mtempsch
pooh-bah

Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
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


Edited by mtempsch (27/09/2002 12:35)
_________________________
/Michael

Top
#118207 - 27/09/2002 12:40 Re: Code Help [Re: Dignan]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
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.
_________________________
Bitt Faulk

Top
#118208 - 27/09/2002 12:57 Re: Code Help [Re: jaharkes]
Dignan
carpal tunnel

Registered: 08/03/2000
Posts: 12345
Loc: Sterling, VA
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.
_________________________
Matt

Top
#118209 - 27/09/2002 13:05 Re: Code Help [Re: Dignan]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Run it on the command line. What does it say?
_________________________
Bitt Faulk

Top
#118210 - 27/09/2002 13:12 Re: Code Help [Re: Dignan]
mtempsch
pooh-bah

Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
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
_________________________
/Michael

Top