Fix building perl libraries for subversion

As requested by @manphiz in pull request #23615.