in reply to Calling a sub-routine in CGI

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:

print qq[<a href="my_script.pl?sub=toggle_on">ON</a>] ;
Then, have my_script.pl test the value of param( 'sub' ), and execute the appropriate subroutine.

If you choose to do something like this, take precautions against malicious posts, and do not execute user input directly.


_______________
DamnDirtyApe
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