Skip to content

Instantly share code, notes, and snippets.

@ruz
Created January 4, 2012 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruz/1559592 to your computer and use it in GitHub Desktop.
Save ruz/1559592 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
package Bar;
use MyBase;
1;
use strict;
use warnings;
package Foo;
use MyBase 'Bar';
1;
use strict;
use warnings;
package MyBase;
require Method::Signatures;
sub import {
my ($class, $base) = (@_);
Method::Signatures->import( { into => scalar caller } );
return unless $base;
my $file = $base;
$file =~ s/::|'/\//g;
$file .='.pm';
require $file;
}
1;
use lib '.';
use Foo;
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment