# WithCarton

- 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 Carton as its package manager. Carton manages dependencies via `cpanfile` and a lock file (`cpanfile.snapshot`), enabling reproducible builds. Use `WithProjectDependencies` to run `carton install` at startup.

## Remarks

Carton only supports project-level dependency installation via `cpanfile`.
Calling `WithPackage` after `WithCarton()` will throw
because Carton does not support installing individual modules.
To install Carton, you may use "cpanm Carton".

## Definition

```go
func (PerlAppResource) WithCarton() PerlAppResource
```

## 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)
