in reply to Moose: Accessing subroutines in packages used by Moose class
You can use code to write your wrappers:
require X11::GUITest; for my $imported (qw/SendKeys FindWindowLike ClickWindow SetEventSendD +elay/) { my $func = "X11::GUITest::$imported"; my $code = do { no strict 'refs'; \&{"$func"} }; my $delegate = sub { my( $self, $arg ) = @_; $code->($arg); }; # Install as mySendKeys etc: no strict 'refs'; *{"my$imported"} = $delegate; };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Moose: Accessing subroutines in packages used by Moose class
by nysus (Parson) on Apr 17, 2016 at 12:43 UTC | |
|
Re^2: Moose: Accessing subroutines in packages used by Moose class
by nysus (Parson) on Apr 17, 2016 at 19:57 UTC | |
by Corion (Patriarch) on Apr 18, 2016 at 07:16 UTC |