in reply to JavaScript and Perl Subroutine

You can not do that. javascript is on the clientside while the perlscript is on the server.
Boris