in reply to Moose: Accessing subroutines in packages used by Moose class
Updated: Please ignore as this won't be useful for the OP problem due to not handling the package parameter (as noted by Corion).
Moose can create such wrappers for you e.g.See Moose::Manual::Delegationpackage Bogus; use Data::Dump 'pp'; sub foo { printf "foo got %s\n", pp([@_]) } sub bar { printf "bar got %s\n", pp([@_]) } sub baz { printf "baz got %s\n", pp([@_]) } package Tester; use Moose; has 'bogus' => ( is => 'bare', default => 'Bogus', handles => [qw( foo bar baz )] ); package main; my $tester = Tester->new; $tester->bar('bar'); $tester->foo('ram'); $tester->baz('ewe');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Moose: Accessing subroutines in packages used by Moose class
by Corion (Patriarch) on Apr 18, 2016 at 11:12 UTC | |
by Arunbear (Prior) on Apr 18, 2016 at 12:22 UTC | |
by Corion (Patriarch) on Apr 18, 2016 at 12:40 UTC | |
by nysus (Parson) on Apr 18, 2016 at 15:04 UTC | |
by Arunbear (Prior) on Apr 18, 2016 at 16:05 UTC | |
by Corion (Patriarch) on Apr 18, 2016 at 15:13 UTC |