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!
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|