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

Need to put a large document of design guidelines online.

What I would like to do is use a database and define about 5 or 6 fields for each entry that could be used in searching the information from a web page.

My problem is, I know some perl, c, and a little on databases, but not much about the web. It would be helpful to see any example that has working code or get pointed to a good tutorial on building a web catalog. Almost every web store front has one of these (look though a list or search for a particular product) so I would suppose that there is a canned solution out there some where, I'm just not looking in the right spot.

  • Comment on simple example source code for building a web catalog

Replies are listed 'Best First'.
Re: simple example source code for building a web catalog
by grep (Monsignor) on Jul 26, 2002 at 19:44 UTC

    It sounds like you want a search engine/site indexer?

    If so Perlfect makes an excellent one that is free (as is beer) and open source (it's perl). It is available for download at www.perlfect.com/freescripts/search/

    It took me about 20 minutes to setup the first time and I modified for special purposes a couple of time with relative ease



    grep
    Just me, the boy and these two monks, no questions asked.
Re: simple example source code for building a web catalog
by ehdonhon (Curate) on Jul 27, 2002 at 01:24 UTC

    Hello dan667, welcome to perlmonks. :)

    I'm not sure how Perl related your question really is, but since this is a Perl site, I'm going to give you a perl answer.

    I think you are on the right track with esentially defining some meta fields about the items you are storing. There are probably more advanced ways to do something like this, but for a beginner, the more simple your solution, the better its chances of succeeding.

    Anyway, after you've set up your database, you'll need to set up a form that requests the parameters that will be searched on. This form will post to a CGI application, and that's where Perl actually starts to come into action.

    As far as parsing the input, my first suggestion is that you go learn about the CGI.pm module. Once you've gotten your form parameters in, you'll need to actually execute a query on your database. That means you need to go learn about DBI. Once you've mastered that, you really have everything you'll need to put the search together and display the results, but you'll probably be doing a lot of work that other people have already done. If you want to construct a search query for your database with the least amount of effort, I suggest you look at DBIx::Recordset. I've had a lot of good results with that module.

    Anyway, that should get you started. I'm sure you will have more queestions as your project progresses.