Handling form content with JavaScript and Perl

I have a music project in Perl which also requires some JavaScript but I seem to be stuck.
I need to execute a program (ffplay) as a command-line application so it runs without displaying a GUI window. The Perl handles the server end of things (sqlite database access). I need JavaScript because I display track names as a button, which when clicked is supposed to run ‘ffplay’ to play the track named in the button code. But the button click requires JavaScript.

When I click a track name button, it only displays the first track, no matter which one I
click.

The following code is in a ‘while’ loop extracting track names from the DB.

print<<EndHTML;
<script>
function process(form) {
    var form=document.Player
        alert ("Track: " + form.Player.Track.value)
}
</script>
EndHTML

print qq{<form name="Player">};
print qq{<input type="button" onClick="process(this.form)" class="alphaButton" name="Track" value="$Track"><br/>};
print qq{</form>};