Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Sub-Exporter CPAN distribution.

Report information
The Basics
Id: 68618
Status: resolved
Priority: 0/
Queue: Sub-Exporter

People
Owner: rjbs [...] cpan.org
Requestors: hanenkamp [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: More help with Sub::Exporter inheritance
It's casually mentioned that Sub::Exporter's import sub is inherited by sub-classes and provides all kinds of wonderful magic automatically to those sub-classes. From experience, I know this magic to be wonderful... so long as I don't need to export anything else. Could the documentation either in the main module or the Cookbook be amended to explain what happens when you do: package Foo; use Sub::Exporter -setup => { exports => [ qw( foo ) ] }; package Bar; use parent 'Foo'; use Sub::Exporter -setup => { exports => ... }; Based on my experience, package Bar has now replaced the import and anything that was exported by Foo is all gone. Perhaps a Moose::Exporter-ish: use Sub::Exporter -setup => { exports => ..., also => 'Foo' }; or something like it to help with this? Cheers, Sterling
This is something I've wanted to support since v0.001 but have not yet found a mechanism that I like. I think about it often. Someday, I will have inspiration... -- rjbs
I didn't mean to close this! -- rjbs