The Perl API will need to connect to the Broker on 426 default, and when using InChargeSession::session->init() in a script you can pass the following command line options
--broker=<brokerIP[:bokerPort]> (also: -b)
--server=<domain-name> (also: -s)
--user=<username> (also: -u)
--password=<password> (also: -p)
--traceServer
--timeout
However, you can bypass the broker to go directly to the port the server is running on, you just need to make sure the server is started on the same port every time.
Then your server option for the Perl adapter would be:
--server=hostname:port/domain
You would then need to open that port on the firewall.