Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

PerlAppResource

Handle
📦 CommunityToolkit.Aspire.Hosting.Perl v13.6.1
type PerlAppResource interface {
IComputeResource
Resource
ResourceWithArgs
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithWaitSupport
}

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 to run carton install at startup.
WithCarton() PerlAppResource
PerlAppResource

A reference to the IResourceBuilder.

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

methodWithCpanMinusbuilder
Configures the Perl application to use cpanm (App::cpanminus) as its package manager instead of the default cpan. Call this before WithPackage to change how packages are installed.
WithCpanMinus() PerlAppResource
PerlAppResource

A reference to the IResourceBuilder.

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

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(options ...*WithLocalLibOptions) PerlAppResource
options...*WithLocalLibOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithLocalLibOptions argument.

Path*stringThe path to the local::lib directory. Relative paths are resolved against the resource's working directory (appDirectory), not the AppHost project. Rooted paths (e.g., /opt/perl-libs or C:\perl-libs) are used as-is. Defaults to "local" (the Carton convention).
PerlAppResource

A reference to the IResourceBuilder.

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

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 was called.
WithPackage(
packageName string,
options ...*WithPackageOptions,
) PerlAppResource
packageNamestringThe name of the Perl module to install (e.g., "Mojolicious", "DBI").
options...*WithPackageOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithPackageOptions argument.

Force*boolIf true, force installation even if the module is already installed or tests fail.
SkipTest*boolIf true, skip running tests during installation.
PerlAppResource

A reference to the IResourceBuilder.

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

methodWithPerlbrewbuilder
Configures the Perl application to use a specific perlbrew-managed Perl version.
WithPerlbrew(
version string,
options ...*WithPerlbrewOptions,
) PerlAppResource
versionstringThe perlbrew version name. Accepts both "5.38.0" and "perl-5.38.0".
options...*WithPerlbrewOptionsOptional settings, described under Options.

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

PerlbrewRoot*stringOptional explicit path to the perlbrew root directory. If null, resolves from the PERLBREW_ROOT environment variable, or defaults to ~/perl5/perlbrew.
PerlAppResource

A reference to the IResourceBuilder.

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

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,
options ...*WithPerlbrewEnvironmentOptions,
) PerlAppResource
versionstringThe perlbrew version name. Accepts both "5.38.0" and "perl-5.38.0".
options...*WithPerlbrewEnvironmentOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithPerlbrewEnvironmentOptions argument.

PerlbrewRoot*stringOptional explicit path to the perlbrew root directory. If null, resolves from the PERLBREW_ROOT environment variable, or defaults to ~/perl5/perlbrew.
PerlAppResource

A reference to the IResourceBuilder.

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

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

A reference to the IResourceBuilder.

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

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(options ...*WithProjectDependenciesOptions) PerlAppResource
options...*WithProjectDependenciesOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithProjectDependenciesOptions argument.

CartonDeployment*boolIf true and using Carton, adds --deployment for reproducible installs from cpanfile.snapshot. Ignored for other package managers.
PerlAppResource

A reference to the IResourceBuilder.

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