[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Re: [multiple links generating HTML pages]



First, a bit of netiquette - Please use a descriptive subject line
such as "multiple links generating HTML pages"

At 12:21 PM -0800 11/23/98, Adam Witney wrote:
>I am new to perl and i am not sure if this is an HTML question or a perl
>question, so i apologise if i am asking this question in the wrong forum.

If you're doing it on a Mac and think it involves Perl, that's good
enough for me!

>I am trying to create a web page with a list of links, each of the links
>calls the same perl script but using a different value specific to the
>link. Basically i am trying to avoid writing 30 html files for the links
>individually and instead want to use the script to generate the required
>HTML file automatically, using fields read from a tab delimited file.
>
>The question i have is what is the best way...if indeed there is a way at
>all (!) ... to get a value from the html link into the perl script?

I think that what you want is a Perl script to handle CGI requests.  The
CGI.pm module handles most of the hassle for this, so you should be able
to concentrate on the specific needs of your application.  Let's say you
have a page that looks like:

  ...
  <UL>
    <LI><A HREF=".../cgi-bin/switch.pl?foo">foo</A>
    <LI><A HREF=".../cgi-bin/switch.pl?bar">bar</A>
    ...
  </UL>
  ...

Your CGI script (e.g., switch.pl) will get called with the parameter
(e.g., "foo", allowing it to generate an appropriate HTML page.

For details, see "MacPerl: Power and Ease", available in both paper
and HTML (http://www.ptf.com/macperl/ptf_book).

-r
Rich Morin:          rdm@cfcl.com, +1 650-873-7841, http://www.ptf.com/~rdm
Prime Time Freeware: info@ptf.com, +1 408-433-9662, http://www.ptf.com
MacPerl: http://www.ptf.com/macperl,   http://www.ptf.com/ptf/products/MPPE
MkLinux: http://www.mklinux.apple.com, http://www.ptf.com/ptf/products/MKLP

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch