Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Calling a sub-routine in CGI

by physgreg (Scribe)
on Aug 09, 2002 at 03:08 UTC ( #188810=note: print w/replies, xml ) Need Help??


in reply to Calling a sub-routine in CGI

You could try
print "<a href='".toggle_on()"'>ON</a>";
Without knowing what toggle_on does. Are you trying to access the subroutine via the web page link? If so, it is not so straightforward, as you have to get the name from a form submission. Then you could have a hash of subroutine references, and if the form submission is in your list, then run it. In which case a bit of code like:
print "<a href='$BASE_URL?action=toggle_on'>ON</a>";
will be what you want in your HTML, where $BASE_URL is set to the appropriate link for your script. I would suggest having a look at CGI.pm for an easy way to deal with form submissions. Hope that helps!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://188810]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2023-12-06 21:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (32 votes). Check out past polls.

    Notices?