Howdy moosers, if I try to use the following package:
--
package Test_Handle;
use Moose;
use MooseX::StrictConstructor;
use DBIx::Custom;
has 'dbix_custom' =>
(
is => 'ro'
, isa => 'DBIx::Custom'
, lazy_build => 1
, handles => qr/.+/
);
__PACKAGE__->meta->make_immutable;
1;
--
perl -e 'use Test_Handle'
--
I get:
Can't use string ("Test_Handle") as a HASH ref while "strict refs" in
use at reader Test_Handle::dbix_custom (defined at Test_Handle.pm line
8) line 5.
BEGIN failed--compilation aborted at -e line 1.
However, if I try to delegate a single method:
--
package Test_Handle;
use Moose;
use MooseX::StrictConstructor;
use DBIx::Custom;
has 'dbix_custom' =>
(
is => 'ro'
, isa => 'DBIx::Custom'
, lazy_build => 1
, handles => qr/update/
);
__PACKAGE__->meta->make_immutable;
1;
--
perl -e 'use Test_Handle'
--
It works. Any ideas? Thanks!
Marcos.