Skip to content
Docs Try Aspire
Docs Try

PerlAppResourceBuilderExtensions

Class static net10.0
📦 CommunityToolkit.Aspire.Hosting.Perl v13.4.0
Extension methods for adding Perl application resources to the application model.
namespace Aspire.Hosting;
public static class PerlAppResourceBuilderExtensions
{
// ...
}
AddPerlApi(IDistributedApplicationBuilder, string, string, string)extensionats export
IResourceBuilder<PerlAppResource>
Adds a Perl API server resource (e.g., Mojolicious, Dancer2) to the application model. Passes the daemon subcommand so HTTP frameworks start a listener.
AddPerlExecutable(IDistributedApplicationBuilder, string, string, string)extensionats export
IResourceBuilder<PerlAppResource>
Adds a Perl executable (compiled binary or PAR-packed application) to the application model. The executable is run directly rather than through the perl interpreter.
AddPerlModule(IDistributedApplicationBuilder, string, string, string)extensionats export
IResourceBuilder<PerlAppResource>
Adds a Perl module to the application model. The module is executed using perl -MModule::Name -e "Module::Name->run()".
AddPerlScript(IDistributedApplicationBuilder, string, string, string)extensionats export
IResourceBuilder<PerlAppResource>
Adds a Perl script resource (worker, CLI tool, background service) to the application model.
WithCarton(IResourceBuilder<TResource>)extensionats export
IResourceBuilder<TResource>
WithCpanMinus(IResourceBuilder<TResource>)extensionats export
IResourceBuilder<TResource>
WithLocalLib(IResourceBuilder<TResource>, string)extensionats export
IResourceBuilder<TResource>
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.
WithPackage(IResourceBuilder<TResource>, string, bool, bool)extensionats export
IResourceBuilder<TResource>
WithPerlbrew(IResourceBuilder<T>, string, string?)extensionats export
IResourceBuilder<T>
Configures the Perl application to use a specific perlbrew-managed Perl version.
WithPerlbrewEnvironment(IResourceBuilder<T>, string, string?)extensionats export
IResourceBuilder<T>
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.
WithPerlCertificateTrust(IResourceBuilder<TResource>)extensionexperimentalats export
IResourceBuilder<TResource>
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.
WithProjectDependencies(IResourceBuilder<TResource>, bool)extensionats export
IResourceBuilder<TResource>
Configures project-level dependency installation for the Perl application. Runs the appropriate install command based on the active package manager:
  • cpanm: cpanm --installdeps --notest .
  • carton: carton install [--deployment]
If the active package manager is cpan (the default), it is automatically switched to cpanm since cpan does not support --installdeps.
View all methods