PIRLswishe Perl module

Download the PIRLswishe-1_0.tgz tarball.

It's actually a little presumptuous to call the distribution of two files a "package", but who knows, you might find them useful.

These Perl programs are meant to be used alongside the SWISH-E program which indexes web pages (but really any files). SWISH-E is a great indexer, but I felt that the existing web front-ends available via 3rd-parties were all a little lacking. In order to customize any of them for my use, I almost would have to re-write them from the ground up anyway.

So I did that, but tried to be a little more generic, and tried to separate the functionality of running SWISH-E from the do-dads and graphics of the front end. I think I did a reasonable job, but you'll be the judge of that. Bill Moseley is almost certainly doing a better job in his development of the swish.pm Perl module (you can find it on CPAN) which is properly object-oriented. I didn't use that because he seemed to be working towards the specification of SWISH-E 2.2, and I needed something that I could depend on with the version of SWISH-E that I had (version 2.0.5).

The two relevant files are one Perl module (PIRLswishe.pm) that has subroutines for handling the details of dealing with SWISH-E. Similarly, there is an example CGI program (PIRLsearch.cgi) which takes input (either from a separate form, a query URL, or itself), calls upon PIRLswishe.pm (which calls SWISH-E), gets the results and displays them to a webpage.

If you only have one CGI program that uses PIRLswishe.pm, just put PIRLswishe.pm in that directory with it, and Perl will find it. If you have several CGI (or other) Perl programs that use the module, you might find it convenient to actually install it, and you can find those details in the file named INSTALL. You can find out how to use PIRLswishe.pm for your own programs by reading its POD via the "perldoc PIRLswishe.pm" command.

PIRLsearch.cgi is just an example, and will have to be modified for you to use (especially the HTML that it displays), but is really quite flexible. On our web pages, we have a search box in with our navigation stuff (see above), which is basically a little form up there on our web pages which calls PIRLsearch.cgi as its form action. PIRLsearch.cgi (or whatever you rename it to) can also parse query URLs (thanks to the CGI.pm module which is now a part of the standard Perl installation) which are of the form regularURL?key=value. For example, you can run a search on our pages by entering this URL:

http://pirlwww.lpl.arizona.edu/search/PIRLsearch.cgi?search_words=io+volcanism

Which would be the same as typing "io volcanism" in a form text box. Additionally, PIRLsearch.cgi is self-contained, it can call itself. If PIRLsearch.cgi isn't given any words to search on, it just displays a page where you can type in words to search on, which will call itself to display the results (go ahead, try it).

I hope that you find these programs helpful, all comments and code improvements are welcome.

Copyright © 2002 Arizona Board of Regents on behalf of the
Planetary Image Research Laboratory, Lunar and Planetary Laboratory
at the University of Arizona.