I think you're blurring the line between HTML and Perl more than is possible here. As I understand it, an HTML anchor is simply a way of requesting a certain page from the web browser. It's not directly a way of executing code. What you may be able to do instead is something like:
Then, have my_script.pl test the value of param( 'sub' ), and execute the appropriate subroutine.print qq[<a href="my_script.pl?sub=toggle_on">ON</a>] ;
If you choose to do something like this, take precautions against malicious posts, and do not execute user input directly.
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
--Friedrich Nietzsche
In reply to Re: Calling a sub-routine in CGI
by DamnDirtyApe
in thread Calling a sub-routine in CGI
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |