perl: make build-time tests optional.

Closes #33119.

Signed-off-by: Tim D. Smith <git@tim-smith.us>