FindPerl — CMake 4.3.4 Documentation

# FindPerl

Finds a Perl interpreter:

    find_package(Perl [<version>] [...])

Perl is a general-purpose, interpreted, dynamic programming language.

## Result Variables

This module defines the following variables:

`Perl_FOUND`

  Added in version 3.3.

  Boolean indicating whether the (requested version of) Perl executable was found.

`Perl_VERSION`

  Added in version 4.2.

  The version of Perl found.

## Cache Variables

The following cache variables may also be set:

`PERL_EXECUTABLE`

  Full path to the `perl` executable.

## Deprecated Variables

The following variables are provided for backward compatibility:

`PERL_FOUND`

  Deprecated since version 4.2: Use `Perl_FOUND`, which has the same value.

  Boolean indicating whether the (requested version of) Perl executable was found.

`PERL_VERSION_STRING`

  Deprecated since version 4.2: Superseded by the `Perl_VERSION`.

  The version of Perl found.

## Examples

Finding the Perl interpreter and executing it in a process:

    find_package(Perl)

    if(Perl_FOUND)
      execute_process(COMMAND ${PERL_EXECUTABLE} --help)
    endif()

## See Also

- The `FindPerlLibs` to find Perl libraries.