Perl.bat must be used with 'call perl' in batch files, which is troublesome

I am trying to compile openssl 1.0.2, which is done with the help of ActivePerl.

However, it seems that all the openssl scripts assume that they are calling perl.exe directly.

Now, I just installed the ActivePerl 5.34 - and perl is actually at perl.bat.

So the scripts that try to run several perl commands just stop after the first one, because you have to use ‘call perl’ if you call it from within a batch script, and wish the execution to continue to the next line (otherwise it continues only until the end of perl.bat)

I suppose I will need to modify the path so that the batches will call perl.exe directly - although it seems that it won’t be as easy as that in the end. Or will it?

Or in fact, since which version of ActivePerl has it been a batch file, instead of just the perl.exe?

You can bypass the batch file and call Perl directly, to find the actual Perl executable path run state exec where perl. Note though that this is technically unsupported, and you may run into issues.

Could you share a script that illustrates the problem you’re having? You shouldn’t have to do anything differently than you would otherwise, so that’s definitely something we should follow up on.

Basically all these do_X.bat scripts do it:

OTOH, it seems that the newer OpenSSL v1.1.1 is not at least sharing those scripts in GitHub, so I believe they have already reacted to this.

We have a perl distro specifically for building OpenSSL: Perl-5.34.0-OpenSSL. If you state activate this project, you’ll also get a copy of the openssl repo (our up-to-date fork rather than the official project for reasons to do with our github integration). This comes with scripts defined in the activestate.yaml file for building and installing OpenSSL from the repo which you can use as you see fit

Ah, thanks for the tip. I am building from a custom branch as well (that includes latest security updates to 1.0.2), and I have just finished with it for now. But this is good to know and we need to check it out as well.

I think in the next release we should try to move on to 1.1.1 anyways, I guess.

We’ve also talked about the issue with the batch files internally and will be prioritizing some work around replacing them with executables, such that you can continue to run scripts the same way you would with any Perl distribution.

Sounds good. Windows cmd line is annoying, because you cannot use symlinks and the batch have severe limitations. But great if you can figure out a custom solution to this.

1 Like

This change (replacing perl.exe with perl.bat in the PATH) breaks every batch file that calls perl. This is a major change to functionality. I’ll avoid editorializing here, but this change shouldn’t have happened. Calling perl directly now (or copying it into the path) causes other problems. Will this change be undone?

1 Like

I agree - I have many, many batch files that call perl and then do something else. This breaks all of them!