# WithPerlbrew

- Module: [CommunityToolkit.Aspire.Hosting.Perl](/reference/api/go/communitytoolkit.aspire.hosting.perl.md)
- Version: `13.6.1`
- Kind: `method`
- Defined on: [`PerlAppResource`](/reference/api/go/communitytoolkit.aspire.hosting.perl/perlappresource.md)
- Source: [GitHub](https://github.com/CommunityToolkit/Aspire/tree/d9c2addac6f527ef2e33712d290b84574b455a3b)

Configures the Perl application to use a specific perlbrew-managed Perl version.

## Definition

```go
func (PerlAppResource) WithPerlbrew(
    version string,
    options ...*WithPerlbrewOptions,
) PerlAppResource
```

## Parameters

- `version` (`string`) -- The perlbrew version name. Accepts both `"5.38.0"` and `"perl-5.38.0"`.
- `options` (`...*WithPerlbrewOptions`) -- optional settings, see [Options](#options)

## Options

Optional parameters are passed in a trailing `options ...*WithPerlbrewOptions` argument.

- `PerlbrewRoot` (`*string`) -- Optional explicit path to the perlbrew root directory. If `null`, resolves from the `PERLBREW_ROOT` environment variable, or defaults to `~/perl5/perlbrew`.

## Returns

[`PerlAppResource`](/reference/api/go/communitytoolkit.aspire.hosting.perl/perlappresource.md) -- A reference to the `IResourceBuilder`.

Returns a handle; failures surface later via `Err()`.

## Applies to

- [`PerlAppResource`](/reference/api/go/communitytoolkit.aspire.hosting.perl/perlappresource.md)
