Trouble with Perl Script requiring arguments

I don't know that much about Perl, but I think this should help:

It appears you need to use the format

$ENV{KMVAR_variablename}

to access KM variables from Perl.