thebeginner has asked for the wisdom of the Perl Monks concerning the following question:

Hi I am new to your forum and hope I am not offending anyone with writing in english not script <grin>. I am very new to programming, but not to web design and am writing in hopes that someone could look at this simple search script.

I adopted it from MSA (Matt's Script Archive which< was later adopted by NMS) It seems it isn't working correctly.. I changed the variables as suggested in readme.txt and during my first test run it's gives me an error. ...????

.....This is the portion of the script I changed....

# USER CONFIGURATION SECTION # Modify these to your own settings. You might have # to contact your system administrator if you do not # run your own web server. If the purpose of these # parameters seems unclear, please see the README file. BEGIN { $DEBUGGING = 1; } my $basedir = '/hamida/www/'; my $baseurl = 'http://www.hamidapharma.com/'; my @files = ('*.html','*/*.html'); my $title = "Hamida Search Program"; my $title_url = 'http://www.hamidapharma.com'; my $search_url = 'http://www.hamidapharma.com/international.htm' +; my @blocked = (); my $emulate_matts_code = 1; my $style = '';
the following config variables only affect the program if $emulate_matts_code is switched off $hit_threshhold is what the minimum amount of hits per page that are required for the match to be outputted
my $hit_threshhold = 1; my @subdirs = ('','/manual','/vmanual'); my $no_prune = 1; # USER CONFIGURATION << END >> # ----------------------------
My site is http://www.hamidapharma.com/international.htm
- go to test page link at the bottom of the page.

MSA - script http://www.scriptarchive.com/search.html

host's cgi-bin. (www.hostway.com)

Any help is greatly appreciated...
thank you mucho....
sima

Replies are listed 'Best First'.
Re: simple search script
by Thelonius (Priest) on Jul 18, 2003 at 21:26 UTC
    It would be more helpful if you provide a direct link to your form: http://www.hamidapharma.com/form.html and to note that the error you are getting is:
    'D:\WWWRoot\hamidapharmacom\www\cgi-bin\search.cgi' script produced no + output
    . This is on IIS-5.0, which I'm not really familiar with. Maybe someone who is familiar with it can say whether this indicates a script problem or a server configuration problem and how you look at the error logs on IIS.

    You can (should) install Perl on your own windows machine so that you can debug your script. Get it from ActiveState. Then you can test your script from the command line: "perl -c search.pl" which will tell you if you have any syntax errors.

    It looks like your base directory should be:

    my $basedir = 'D:\WWWRoot\hamidapharmacom\www';
    but that won't give the error you're getting. It looks like most of your site files end in ".htm" instead of ".html", so you'll need to change that too.
      I will try all of your suggestion
      you are too kind..
      Thank you again
Re: simple search script
by LazerRed (Pilgrim) on Jul 18, 2003 at 20:43 UTC
    I'm betting that the your problem is in:

    my @files = ('*.html','*/*.html');

    Try using just:

     my @files = ('*.html');

    And see if it works then.

    LR
Re: simple search script
by Anonymous Monk on Jul 30, 2003 at 18:03 UTC
    Nick Cleaton/Dave Cross.. have been kind enough
    to help me out in figuring why I am still getting
    this error message:

    'D:\WWWRoot\hamidapharmacom\www\cgi-bin\search.cgi
    but even after making the changes
    it still doesn't work and hostway NEVER gets
    back to inquires re:script.

    I am using *.htm and *.html.. because most
    of the files are .htm but not all

    Here is the script I am using:

    USER CONFIGURATION SECTION ## Modify these to your own settings.
    You might have to
    # contact your system administrator if you do not run
    # your own web server. If the purpose of these
    # parameters seems unclear, please see the README file.
    # BEGIN { $DEBUGGING = 1; }
    my $basedir = 'D:\wwwroot\hamidapharmacom\www';
    my $baseurl = 'http://www.hamidapharma.com/';
    my @files = ('*.html,*.htm');
    my $title = "Hamida Search Program";
    my $title_url = 'http://www.hamidapharma.com';
    my $search_url = 'http://www.hamidapharma.com/form.html';
    my @blocked = ();
    my $emulate_matts_code = 1;
    my $style = '';

    # the following config variables only affect the program if
    # $emulate_matts_code is switched off $hit_threshhold is
    what the minimum
    # amount of hits per page that are required for the match
    to be outputted
    my $hit_threshhold = 1;
    my @subdirs = ('','/manual','/vmanual');
    my $no_prune = 1;
    # # USER CONFIGURATION << END >>
    # ---------------------------- # (no user serviceable parts beyond here)