One way to do something similar to what you are wanting that I have done with vbscript, cscript and cmd apps but not with Perl is to Call the script and pass arguments from the AO Profile using LUA to the script. For example I used this with a custom Remedy script and passed the Alarm.get variables that i needed from the LUA AO Script to a VBScript and then run code in the VBScript and then return variables back to LUA for use with updating the Alarm. For my situation it sends the Alarm Fields to VBS, VBS Creates the ticket with web services and then Echos back the Ticket Number to LUA and places it in Custom 1. Below is the LUA portion of the AO Script. Maybe this will help
--Dim Vars
local a,f,s
--Get the Alarm
--a = alarm.get("XX49920781-94199")
a = alarm.get("VK03385134-00264")
printf(a.message.." "..a.user_tag1.." "..a.user_tag2.." "..a.nimid.." "..a.hub.." "..a.robot)
--Run External VBS to Process the Web Service Calls and Return Incident Number
f = assert(io.popen("cscript F:\\RemedyScripts\\RemedyCreate.vbs ".."\""..a.message.."\"".." ".."\""..a.user_tag1.."\"".." ".."\""..a.user_tag2.."\"".." ".."\""..a.nimid.."\"".." ".."\""..a.hub.."\"".." ".."\""..a.robot.."\"",'r'))
s = assert(f:read('*a'))
s = string.gsub(s, '^%s+', '')
s = string.gsub(s, '%s+$', '')
s = string.gsub(s, '[\n\r]+', ' ')
printf(s)
tblremedy = split(s,":")
if table.maxn(tblremedy) > 1 then
printf(trim(tblremedy[2]))
strremedyid = trim(tblremedy[2])
else
printf("NO SPLIT FOR VALUES")
strremedyid = ""
end
--Update Alarm Custom Field 1 with the Remedy Ticket Number
vals = {nimid=a.nimid,custom_1=strremedyid}
alarm.set(vals)