Commit | Line | Data |
---|---|---|
b07c7a9d | 1 | #!/usr/bin/perl |
2 | ||
3 | package Bench::Construct; | |
4 | use Moose; | |
5 | ||
6 | has class => ( | |
7 | isa => "Str", | |
8 | is => "ro", | |
9 | ); | |
10 | ||
11 | has args => ( | |
12 | isa => "ArrayRef", | |
13 | is => "ro", | |
14 | auto_deref => 1, | |
15 | ); | |
16 | ||
17 | sub code { | |
18 | my $self = shift; | |
19 | ||
20 | my $class = $self->class; | |
21 | my @args = $self->args; | |
22 | ||
23 | sub { my $obj = $class->new( @args ) } | |
24 | } | |
25 | ||
26 | __PACKAGE__; | |
27 | ||
28 | __END__ |