Skip to content
DocsTry Aspire
DocsTry

PerlAppResource

Handle
📦 CommunityToolkit.Aspire.Hosting.Perl v13.4.0
interface PerlAppResource
extends IComputeResource,
IResource,
IResourceWithArgs,
IResourceWithEndpoints,
IResourceWithEnvironment,
IResourceWithProbes,
IResourceWithWaitSupport,
IResourceWithServiceDiscovery {
withCarton(): PerlAppResource;
withCpanMinus(): PerlAppResource;
withLocalLib(path?: string): PerlAppResource;
withPackage(
packageName: string,
force?: boolean,
skipTest?: boolean): PerlAppResource;
withPerlbrew(
version: string,
perlbrewRoot?: string): PerlAppResource;
withPerlbrewEnvironment(
version: string,
perlbrewRoot?: string): PerlAppResource;
withPerlCertificateTrust(): PerlAppResource;
withProjectDependencies(cartonDeployment?: boolean): PerlAppResource;
}

Methods

methodwithCartonbuilder
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``1` to run `carton install` at startup.
withCarton(): PerlAppResource
PerlAppResource
methodwithCpanMinusbuilder
Configures the Perl application to use cpanm (App::cpanminus) as its package manager instead of the default cpan. Call this before `WithPackage``1` to change how packages are installed.
withCpanMinus(): PerlAppResource
PerlAppResource
methodwithLocalLibbuilder
Configures the Perl application to use a local::lib directory for module isolation. Sets `PERL5LIB`, `PERL_LOCAL_LIB_ROOT`, `PERL_MM_OPT`, and `PERL_MB_OPT` environment variables so that modules are resolved from and installed into the local directory.
withLocalLib(path?: string): PerlAppResource
pathstringoptional= local
PerlAppResource
methodwithPackagebuilder
Adds a Perl package (module) to be installed before the application starts. Uses the configured package manager: cpan by default, or cpanm if `WithCpanMinus``1` was called.
withPackage(
packageName: string,
force?: boolean,
skipTest?: boolean): PerlAppResource
packageNamestring
forcebooleanoptional= False
skipTestbooleanoptional= False
PerlAppResource
methodwithPerlbrewbuilder
Configures the Perl application to use a specific perlbrew-managed Perl version.
withPerlbrew(
version: string,
perlbrewRoot?: string): PerlAppResource
versionstring
perlbrewRootstringoptional
PerlAppResource
Configures the Perl application to use a specific perlbrew-managed Perl version. This resolves the Perl executable from the perlbrew installation and updates the resource's command and environment variables so that all subsequent operations use the specified Perl version.
withPerlbrewEnvironment(
version: string,
perlbrewRoot?: string): PerlAppResource
versionstring
perlbrewRootstringoptional
PerlAppResource
Configures certificate trust for the Perl application by setting SSL/TLS environment variables that common Perl HTTP libraries respect. Sets `SSL_CERT_FILE` (IO::Socket::SSL / LWP), `PERL_LWP_SSL_CA_FILE` (LWP::UserAgent), and `MOJO_CA_FILE` (Mojolicious) to the certificate bundle path provided by Aspire.
withPerlCertificateTrust(): PerlAppResource
PerlAppResource
Configures project-level dependency installation for the Perl application. Runs the appropriate install command based on the active package manager: - - If the active package manager is `cpan` (the default), it is automatically switched to `cpanm` since `cpan` does not support `--installdeps`.
withProjectDependencies(cartonDeployment?: boolean): PerlAppResource
cartonDeploymentbooleanoptional= False
PerlAppResource