Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Software Error - URGENT

Quote Reply
Software Error - URGENT
Hi,

I have had an ad-on to the Links System, so I realise it is not going to be the same as the rest of you, but... this error looks like a standard error...

Software error:
Execution of /usr/local/etc/httpd/cgi-bin/links/user.cgi aborted due to compilation errors.
For help, please send mail to the webmaster (webmaster@nobags.com), giving this error message and the time and date of the error.

Can anyone help me sort this?

Thanks


Quote Reply
Re: Software Error - URGENT In reply to
Check your error.log. It will tell you where.

Odds are, if you didn't edit that file, then a change you made to one of the included files --- HTML_Templates.pm, Links.pm, etc is bad.

It means there is a problem in the perl code -- but without looking at the error log, it's a needle in a haystack.



Quote Reply
Re: Software Error - URGENT In reply to
um... can you take a look at this for me? I have changed nothing and it worked before until now.

I will take a look at my error logs.

Please get back to me abeaton@nobags.com.

Thanks

Quote Reply
Re: Software Error - URGENT In reply to
Hey,

I have looked through my error logs and it says...

[Fri May 5 02:15:12 2000] contest.cgi: Global symbol "$user" requires explicit package name at /usr/local/etc/httpd/cgi-bin/links/contest.cgi line 58.
[Fri May 5 02:15:12 2000] contest.cgi: Global symbol "$pass" requires explicit package name at /usr/local/etc/httpd/cgi-bin/links/contest.cgi line 60.
[Fri May 5 02:15:12 2000] contest.cgi: Execution of /usr/local/etc/httpd/cgi-bin/links/contest.cgi aborted due to compilation errors.


What do these mean?

Quote Reply
Re: Software Error - URGENT In reply to
It means you are using the $user and $pass variales without declaring them with "my" or a package name.

To get more specific than that I'd have to see how you are trying to use them.... since it could be as simple as adding "my" or a complex re-think of the logic of what you are trying to do :)


BTW... those error messages are 2 weeks old, according to your time stamp.

You'll find the new errors at the end of the error.log, and the best way to look at them is to use 'tail' to show the end of the file.

Or, here is a small script I use to show me the last few errors in my browser. You'll have to make sure your error.log is world readable by the server:

<pre>#!/usr/local/bin/perl
#######################################################################
# Error Log Script
#######################################################################

# Change the path to the path to your error log!
$error_log = "/usr/local/apache/logs/error.log";

# Print out a content-type for HTTP/1.0 compatibility
print "Content-type: text/html\n\n";

print "<html><title>Recent Server Errors</Title>\n";
print "<H3>Recent Server Errors</H3><HR>\n";
## you can change the -50 to any number you want to see ... 10, 20, etc.
open (ELOG, "tail -50 $error_log | tail -50 |") || die $!;
while (<ELOG>) {
print; print "\n<HR>\n";
}
close (ELOG);
print "";
exit;
</pre><p>

I modified this from some code fragments I saw on the net about 5 or 6 years ago. It's not mod_perl compatible, and it was meant to be quick and dirty :)
But it's useful.

Quote Reply
Re: Software Error - URGENT In reply to
Hey,

If you go to http://www.nobags.com/cgi-bin/links/user.cgi?validate=1 this is where the software error appears.

They go to that URL to validate thir account after filling in the form @ http://www.nobags.com/cgi-bin/links/signup.cgi.

I hope this helps you.

Cheers


Quote Reply
Re: Software Error - URGENT In reply to
oh, I used the wrong line in the logs! Stupid!?!?

Ok, here are the correct longs...

[Fri May 19 12:13:50 2000] user.cgi: Global symbol "%in_r" requires explicit package name at /usr/local/etc/httpd/cgi-bin/links/user.cgi line 147.
[Fri May 19 12:13:50 2000] user.cgi: Execution of /usr/local/etc/httpd/cgi-bin/links/user.cgi aborted due to compilation errors.


Cheers

Quote Reply
Re: Software Error - URGENT In reply to
Ok...

There is some problem with $user and $pass because it's confused with the "old" User and Pass that were used in a beta version, and were later changed to Username and Password.

Make sure your database table has Username and Password (not User and Pass) as field names, and then make sure your forms are passing Username and Password as the field "Name" not "pass" and "user"

You can then search the user.cgi file to make sure that any references to "User" and "Pass" are changed as well.

That should make things work.

It may not solve this problem <G> but it's a start.



Quote Reply
Re: Software Error - URGENT In reply to
I am really really stupid when it comes to this. I know nothing about programming (although I am planning on taking a basic course =)

IS there a simpler way of saying that and doing it?

Cheers,
Alex

Quote Reply
Re: Software Error - URGENT In reply to
<pre>[Fri May 19 12:13:50 2000] user.cgi: Global symbol "%in_r" requires explicit
package name at /usr/local/etc/httpd/cgi-bin/links/user.cgi line 147.
</pre><p>
It's declared in the user.cgi file at the top of sub signup_user :

my $in_r = &cgi_to_hash ($in);

Make sure you didn't change that routine, or eliminate that line.

Also, make sure that you are using

%{$in_r}

in the passes to the routines.

$in_r is a hash reference, %{$in_r} is the HASH itself.







Quote Reply
Re: Software Error - URGENT In reply to
In the table mantience it is username and password and has always been this

Quote Reply
Re: Software Error - URGENT In reply to
Hi,

If you are not able to find it, you can email me your user.cgi

It's probably just a % instead of a $ or something like that. Hard to do without seeing your file. My line numbers don't match yours.



Quote Reply
Re: Software Error - URGENT In reply to
Ok, I have mailed it to you.

Cheers,
Alex

Quote Reply
Re: Software Error - URGENT In reply to
Think I found it:

(Even with the binary garbage)

Code:
$in_r{'Bought_What'} =3D join",", $in->param('Bought_What'
There is this line. What jumps out is $in_r{'Bought_What'} ...

You've declared a HASH %in_r by default by doing that (which is what the error message is saying). But $in_r is a POINTER (reference) to a HASH.

You meant to do: $in_r->{'Bought_What'}

which is the reference to the element.



Quote Reply
Re: Software Error - URGENT In reply to
So what should I do now then??

Quote Reply
Re: Software Error - URGENT In reply to
BTW.... don't confuse this with the:

$in->param('Bought_What')


--> note the
Code:
()
not the
Code:
{}
$in->param () is a FUNCTION call .... through CGI.pm where param() is a function in CGI.pm that is referenced by the $in->

(simplistic... but)





Quote Reply
Re: Software Error - URGENT In reply to
Replace the:

$in_r{'Bought_What'}


with

$in_r->{'Bought_What'}

and see if that fixes it.

Quote Reply
Re: Software Error - URGENT In reply to
Wow! It works... Thanks very much for all your help.

Very kind...

Thanks
Alex

Quote Reply
Re: Software Error - URGENT In reply to
Great!

Now I'm off to bed.....

Yes... 9am here on the east coast. Bed time :) <G>