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

I'm learning the CGI.pm modual right now, and came accross a little stumbling block. I was having many people telling me that their browsers were not reading the code properly without the modual, otherwise I would just do regular links.

What I am looking for, is how to call internal links on a page, so that http://some.domain.com/cgi-bin/page.cgi -- once you click on a link for "site", you will be taken to http://some.domain.com/cgi-bin/page.cgi?site, where "site" is a new document, but imbeded.

I really don't know what these are, so you'll have to excuse me for how I "butcher" the description.

I am not using any DB (have yet to learn), so any help would be appreciated.

Replies are listed 'Best First'.
Re: CGI.pm form: links
by rdfield (Priest) on Jan 02, 2003 at 11:11 UTC
    The same script is being called but the parameter (ie the bit after the question mark) tells the script what data is required to populate the returned page with. In your case you would have a perl script called 'page.cgi' which retrieves some data from a database based on the key value provided as the parameter and populates a template with this data.

    rdfield

Re: CGI.pm form: links
by t0j0 (Novice) on Jan 03, 2003 at 04:39 UTC
    i didn't really understand what you really want..it seems to me you are looking at making a link using the CGI.pm module.. then here you go
    use CGI qw/:standard/; print header,start_html('Link Example'), a({href=>'http://www.host.com'},'This is a link'),end_html;
    hope this will help
      Sorry I can't describe it any further... Don't know exactally what it is, but I see it quite a bit. I'll keep searching on Google and tear apart some code if I find any good example -- will try to get what I want from there. Also that little snippit you posted, I wanted too; thanks.
Re: CGI.pm form: links
by BUU (Prior) on Jan 02, 2003 at 03:32 UTC
    you mean anchors? Like #foo?
      Similar, but no. An example would be found on this site -- the different nodes you can choose from. The main script is found on index.pl, however each node has a link, that directs to index.pl?node_id=XXX -- this is what I am looking at. I've had various scripts that do this (d/l'd), but trying to study them wasn't much success (the HD's that had the code was currupted a while ago, so I can't show you the code).