If HTTP::ProxyPAC fails during construction, it may not have reached any destination request. Its automatic interpreter selection tries the JavaScript module, then JE; construction fails if neither is available in that Perl runtime.

With JE already available, select it explicitly and evaluate the destination:

use HTTP::ProxyPAC;

my $pac = HTTP::ProxyPAC->new('/path/to/network.pac', interp => 'je');
my @routes = $pac->find_proxy('http://service.example/status');

A local PAC file separates interpreter evaluation from fetching PAC itself. The constructor can also accept a PAC URL, script string reference or open handle.

Choose the result context deliberately. Scalar find_proxy returns the first result; the shown list context preserves multiple candidates. Pass each Result object's proxy value into the actual HTTP client's configuration, and handle a direct result explicitly.

The evaluator chooses routes; the HTTP client still has to connect and implement the required fallback policy. Keeping all candidates matters only if that client will try them in the intended order.

Mikanda mikatakata