hmmm.... I don't think you can. Can you explain better what you're doing?
Perl prints javascript out to the browser, but it can't call javascript functions per se. You have to initiate javascript functions from within the browser using events, such as onload or submit.
Or maybe someone knows something I am not aware of.