CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Problems with debugging

 



neveryonas
Novice

Nov 13, 2003, 8:22 AM

Post #1 of 15 (1476 views)
Problems with debugging Can't Post

Dowloaded a cgi/perl script, and I am a total novice at this....the program works fine, except for the upload cgi, for uploading an image. !/usr/bin/perl-w is the path in the script, which according to my server is correct. Support at my server gave me the output which had tons of errors, only I don't understand them. All I get when the script is executed, is a server error, premature script headers, no error number or anything. Hoping someone has the time to help me out!


davorg
Thaumaturge / Moderator

Nov 13, 2003, 9:51 AM

Post #2 of 15 (1475 views)
Re: [neveryonas] Problems with debugging [In reply to] Can't Post

If you show us the errors then we can probably help you.

Be warned, however, that 95% of the CGI programs that you download from the internet are fundementally broken.

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


neveryonas
Novice

Nov 13, 2003, 10:12 AM

Post #3 of 15 (1473 views)
Re: [davorg] Problems with debugging [In reply to] Can't Post

okay, that would be great. Should I just copy and paste the entire script into here....or how should I do it...


neveryonas
Novice

Nov 13, 2003, 11:40 AM

Post #4 of 15 (1470 views)
Re: [neveryonas] Problems with debugging [In reply to] Can't Post

I uploaded the up.cgi. DOn't know if I am allowed to do this, but I figured that would be the better way...
Attachments: up.cgi (3.85 KB)


KevinR
Veteran


Nov 13, 2003, 12:22 PM

Post #5 of 15 (1469 views)
Re: [neveryonas] Problems with debugging [In reply to] Can't Post

try add a space just before the '-' in the very first line of the script (the path to perl)

#!/usr/bin/perl -w

right now your script has no space there:

#!/usr/bin/perl-w
-------------------------------------------------


neveryonas
Novice

Nov 13, 2003, 1:18 PM

Post #6 of 15 (1465 views)
Re: [KevinR] Problems with debugging [In reply to] Can't Post

Ok, I changed that, and it doesn't go anywhere now....no error, just becomes stuck...


neveryonas
Novice

Nov 13, 2003, 8:59 PM

Post #7 of 15 (1462 views)
Re: [neveryonas] Problems with debugging [In reply to] Can't Post

These are the errors...and I am not a perl programmer, I have limited programming abilities. Any advice would be greatly appreciated!

This is the output of the script:
-----------------------------------------
Unquoted string 'loginname' may clash with future reserved word at ./up.cgi line 70.
Name 'main::logo' used only once: possible typo at ./up.cgi line 68.
Name 'main::FILES_UPLOADED' used only once: possible typo at ./up.cgi line 154.
Name 'main::preview' used only once: possible typo at ./up.cgi line 67.
Name 'main::started' used only once: possible typo at ./up.cgi line 69.
Name 'main::Number' used only once: possible typo at ./up.cgi line 107.
Name 'main::root' used only once: possible typo at ./up.cgi line 26.
Name 'main::ALLOW_INDEX' used only once: possible typo at ./up.cgi line 117.
Name 'main::FILENAME_IN_QUESTION' used only once: possible typo at ./up.cgi line 122.
Use of uninitialized value in concatenation (.) or string at netcard2.cfg line 84.
Use of uninitialized value in concatenation (.) or string at netcard2.cfg line 84.
Content-type: text/html


bad directory


KevinR
Veteran


Nov 14, 2003, 12:11 AM

Post #8 of 15 (1461 views)
Re: [neveryonas] Problems with debugging [In reply to] Can't Post

on line 70 of the script, change if from this:

if (loginname eq ""){

to this:

if ($loginname eq ""){

and retry the script
-------------------------------------------------


davorg
Thaumaturge / Moderator

Nov 14, 2003, 1:38 AM

Post #9 of 15 (1459 views)
Re: [neveryonas] Problems with debugging [In reply to] Can't Post


In Reply To
I uploaded the up.cgi. DOn't know if I am allowed to do this, but I figured that would be the better way...


Is that the file exactly how you downloaded it? Or have you edited it in some way?

I know I said that most of the Perl programs on the internet were crap, but at least most of them compile!

Have you tried contacting hte author and pointing out that he's distributing rubbish?

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks


neveryonas
Novice

Nov 14, 2003, 7:18 AM

Post #10 of 15 (1456 views)
Re: [davorg] Problems with debugging [In reply to] Can't Post

Here is the original up.cgi. The only thing I knowingly changed was the usr/bin/perl5 to usr/bin/perl, on the advice of my server, who said it would not work the original way. However, I have deleted and uploaded so many times, I may have inadverdently changes something. I tried the $login the way you suggested KevinR, but that didn't seem to help either. THanks!Crazy


KevinR
Veteran


Nov 14, 2003, 2:23 PM

Post #11 of 15 (1453 views)
Re: [davorg] Problems with debugging [In reply to] Can't Post


In Reply To
I know I said that most of the Perl programs on the internet were crap, but at least most of them compile!



LOL@DAVE Smile

True, so true.....
-------------------------------------------------


James
Troll

Nov 15, 2003, 1:48 PM

Post #12 of 15 (1449 views)
Re: [davorg] Problems with debugging [In reply to] Can't Post


In Reply To
... 95% of the CGI programs that you download from the internet are fundementally broken.



Perhaps 95% is just a tad hyperbolic? Wink


neveryonas
Novice

Nov 17, 2003, 9:24 AM

Post #13 of 15 (1440 views)
Re: [James] Problems with debugging [In reply to] Can't Post

Okay, I give up trying to figure it out. If I had money, I would pay for a script that would allow users to have a simple web page about their pet. However, at the moment, we are just starting out, and there is no income coming in, and I don't have the money to fork out. Do you guys know of a good, free script, that I can use that would allow my users to do this. I found ones, that are just file managers, that allow people to ftp their own files onto my server, but I would prefer one where people, who don't know anything about html, to easily create one, and allow them to upload a picture. ANy suggestions would be greatly appreciated! I have scoured the internet looking for something suitable and can't find anything!


James
Troll

Nov 18, 2003, 10:29 AM

Post #14 of 15 (1438 views)
Re: [neveryonas] Problems with debugging [In reply to] Can't Post

Have you looked in the Community Builders section of the Perl Archive directory? You might find something in the Web Sites and/or Home Pages subcategories.


davorg
Thaumaturge / Moderator

Nov 19, 2003, 2:28 AM

Post #15 of 15 (1433 views)
Re: [James] Problems with debugging [In reply to] Can't Post


In Reply To

In Reply To
... 95% of the CGI programs that you download from the internet are fundementally broken.


Perhaps 95% is just a tad hyperbolic? Wink


Given that the vast majority of them seem to be based on Matt Wright's scripts, I really don't think that's an exaggration at all :)

--
Dave Cross, Perl Hacker, Trainer and Writer
http://www.dave.org.uk/
Get more help at Perl Monks

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives