PDA

View Full Version : Perl program won't work?


penelope
04-04-1999, 07:10 PM
Hello all:

I'm having trouble trying to set up our search script. It's a nice search script that stores results in flat text files instead of doing a full site search everytime somebody tries to search, thus resulting in a) better performance for my user and b) less load on the server. :-) I REALLY want to use this perl script.

Code Begin::

#!/usr/bin/perl5.00404
#
# search.pl - The Perlfect Search Engine
# version 1.1
#
# (c) 1998 Giorgos Zervas, Perlfect Solutions
# giorgos@perlfect.com
# http://perlfect.com
#
# 15 November 1998
#
# requires the following perl modules:
# CGI, CGI::Carp, Data: http://www.aota.net/ubb/biggrin.gifumper
#
# requires the following scripts
# indexer.pl >= v1.1
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#


use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Data: http://www.aota.net/ubb/biggrin.gifumper;

my $version = "1.1";

Code End::

it just errors our 500 if I hit it via a web page. perl5.00404 -c or perl5 -c results in:

"Args must match #! line at search.pl line 1."

I'm thinking that we don't have the CGI, CGI::Carp or Data: http://www.aota.net/ubb/biggrin.gifumpter modules installed.

Can someone please help me out?

Thanks VERY much!

Peace,
Penelope

Terra
04-04-1999, 07:41 PM
You have the script file mode setuid...

'rwsr-xr-x'

just change it to:
'rwxr-xr-x'

and it will clear your problem...

--
Terra
sysAdmin
FutureQuest

penelope
04-04-1999, 08:15 PM
Thanks Terra! Cleared up the arg error but I'm still getting an internal 500 error. Do we have those modules installed? The script logfile didn't seem to give any real clarity...

Peace,
Penelope

Terra
04-04-1999, 11:17 PM
CGI and Data::Dumper are both installed in the core...

I use them quite frequently... http://www.aota.net/ubb/wink.gif

--
Terra
sysAdmin
FutureQuest

penelope
04-04-1999, 11:57 PM
*sigh* can someone look at this and help figure out why it is 500 erroring on me?

http://www.betabites.com/index2.html is the URL, the search script is at the bottom. Do a view source to see how i've called it.

the search.pl file itself is in http://www.betabites.com/cgi-bin/search.pl
or /big/dom/xbetabites/cgi-bin/search.pl.

Any and all assistance would be most gratefully accepted.

Thank you in advance!

Peace,
Penelope

Terra
04-05-1999, 12:02 AM
I took a closer look at search.pl and believe I found the problem...

On Line 99 you are outputting "The keywords are: @keywords\n"; (I assume for debugging) *before* you are outputting the header on line 104...

The header must always come first, or you will get this error... Just take Line 99 and place it after the 'print $query->header;' and it should work...

For the sake of argument, just comment out line 99 first and see if that works..

--
Terra
--Code Warrior--
FutureQuest

penelope
04-05-1999, 12:25 AM
CodeWarrior:

I tried both of your suggestions and continue to get the 500 internal error. http://www.aota.net/ubb/frown.gif I've seen this script in action on another site, supposedly "as-is". Any other ideas?

Peace,
Penelope

Justin
04-05-1999, 12:46 AM
Just a guess, but shouldn't the shebang line be #!/usr/bin/perl ??? Or is it ok to specify the version (thought that only applied to Win32...)

------------------
Justin Nelson
FutureQuest Support

penelope
04-05-1999, 12:57 AM
I gave it a shot Justin. It seemed to make no difference. Thanks for trying!

Peace,
Penelope

Terra
04-05-1999, 01:04 AM
I just checked your script log, you are getting an 'Out of memory!' error...

Seems this program wants more than 8Mb of ram to run... http://www.aota.net/ubb/frown.gif

I will increase your limit to 15Mb and see if that helps, but cannot allocate much more than that...

--Terra

Terra
04-05-1999, 01:14 AM
I have tested it, and it works now...

--Terra

penelope
04-05-1999, 09:02 AM
Wow. Do you have any idea why it would want so much? I chose it because I thought that it was an efficient script and that using the flat files to store data instead of actually doing a site search for keywords would be best. http://www.aota.net/ubb/frown.gif Does anyone have a better recommendation for a search script?

Thank you,
Penelope

Terra
04-05-1999, 09:50 AM
I wouldn't stress it...

The biggest hit is the indexer part, and would recommend running it late at night...

I have run this on a very LARGE test site, and the search portion runs very quickly...

The search takes up a chunk of memory (to be expected to due it's nature) but has a short run time (less than 3 seconds)...

What I watch for are scripts that have both a large memory requirement AND long run CPU time... The limits are there only to stop runaway scripts...

I do adjust parameters for individual domains depending on needs, for which I have already done for your domain... Go ahead and use this, if it fits your needs... If it should ever begin to show signs of overloading I would get in contact with you...

Fair enough? http://www.aota.net/ubb/wink.gif

--
Terra
--Enjoy the ride--
FutureQuest

hearts
04-05-1999, 11:18 AM
Hey Terra, that is totally awesome! Anyone have any further questions as to why FQ is better than the rest?

The lacking hosting companies, would have shut this site down without as much as a warning!

penelope
04-05-1999, 04:23 PM
Terra:

That is very nice of you. Thank you so very much.

Peace,
Penelope