The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Orochi::Declare - Declarative Style Orochi DI

SYNOPSIS

use Orochi::Declare;

my $c = container {
    inject_constructor '/myapp' => (
        class => 'MyApp',
        args  => {
            foo => bind_value '/myapp/foo',
        }
    );
    inject_constructor '/myapp/foo' => (
        class => 'MyApp::Foo',
        args  => {
            bar => bind_value '/myapp/foo/bar'
        }
    );
    inject_literal '/myapp/foo/bar' => 1;
}

my $myapp = $c->get('/myapp');