Object-InsideOut - Re: :Restricted methods imported into child classes?

Posted on Thu Jan 19 06:36:11 2006 by jdhedden in response to 1643 (See the whole thread of 9)
Re: :Restricted methods imported into child classes?
Turns out there was a problem dealing with Exporter. I uploaded v1.33 which fixes this. Here's an example:
use strict; use warnings; package Foo; { use Object::InsideOut 'Exporter'; BEGIN { our @EXPORT_OK = qw(foo_name); } sub foo_name { return (__PACKAGE__); } } package Bar; { use Object::InsideOut 'Foo' => [ qw(foo_name) ]; sub get_foo_name { return (foo_name()); } } package main; print("Bar got Foo's name as '", Bar::get_foo_name(), "'\n");
Note the use of the BEGIN block to ensure the @EXPORT_OK array gets populated properly.
Direct Responses: 1698 | Write a response