in reply to OT: Running Event after ClickOn browser event

...it will cause an event to generate a particular piece of code...

That's a little vague but this might be enough to get you started. It's JS but the use of Perl often involves sidebars like JS and SQL.

<script type="text/javascript"> function postToApp () { alert('Generating code... Or opening a CGI with args... or...') return false } document.write('<img src="" style="border:1px solid ') document.write('black;width:80px;height:100px;" ') document.write('onclick="postToApp()" ') document.write('alt="no source!" />') </script> <noscript> Special functions are reserved for those less paranoid. Enable JavaScript in your browser to use this. </noscript>
The Rhino and The Howler Monkey are both good investments, of course.