in reply to Re^3: converting libraries into modules
in thread converting libraries into modules

It could be as simple as:

use vars '@EXPORT'; @EXPORT = qw( list of methods to curry ); sub import { my $class = shift; my $curried_object = $class->new(); my $caller = caller(); for my $export ( @EXPORT ) { *{ $caller . "::$export" } = sub { $curried_object->$export( @ +_ ) }; } }

Replies are listed 'Best First'.
Re^5: converting libraries into modules
by wazoox (Prior) on Mar 07, 2006 at 13:12 UTC
    I like this one, it's very clever and it will even work with InsideOut or closure objects, that's great :)