# PerlAppResource.WithCarton

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

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
type PerlAppResource interface {
    // ... omitted for brevity
    WithCarton() PerlAppResource
}
```

## Signature

```go
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()`.

## Defined on

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