Correct me if I'm wrong, but OP said:
Turns out it was because the PATH didn't exist in the Jenkins environment.
Why would the open succeed to an unknown executable?
As far as I understood OP, missing PATH meant that the script was unable to run executables except by full path:
$ env LC_ALL=C PATH="" /usr/bin/perl -E'open my $fh, "-|", $_ and say
+"success" or say $! for "ls", "/bin/ls"'
No such file or directory
success
So the question was: how does open succeed despite inability to find the executable due to empty $PATH?
By the way, thanks for the spelling reminder.