in reply to How can I run a subroutine from an anchor tag (a href....../a)?

Anchor tags do not "call out" to perl subroutines. They are simply links to URLs that a browser can make GET requests to. You can write a CGI script which receives the GET request and then dispatches it to whatever subroutine you have written.
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print
  • Comment on Re: How can I run a subroutine from an anchor tag (a href....../a)?

Replies are listed 'Best First'.
Re: Re: How can I run a subroutine from an anchor tag (a href....../a)?
by sierrathedog04 (Hermit) on Feb 18, 2001 at 17:22 UTC
    One approach involves creating an HTML form whose form handler is the CGI script you want to run.

    Another approach is to dispense with form and its GET request entirely. If your domain is mydomain.com and your script is named myscript.pl then have your link point to http://mydomain.com/myscript.pl

    Once the user clicks on http://mydomain.com/myscript.pl, he will only see whatever output it is that myscript.pl creates, so you must do some additional CGI programming in order to create that output. You might wish to familiarize yourself with CGI.pm in order to help you do so. You can learn about CGI.pm here.