In your import method, you have the following:
while ($_ = shift) {
Exporter::NoWork failed for me while I was using Moose and somewhere in
the internals, when trying to subclass something, $_ gets aliased to a
string constant, causing the 'Exporter::NoWork' import method to die
with a 'Modification of a read-only value' error.
The fix is simple:
while ( local $_ = shift ) {
Because $_ has not been localized, if it already has a value and it's
aliased to a constant, then it's 'read only' and the assignment fails.
The following snippet shows how this can work:
sub foo {
while ($_ = @_) {}
}
foreach ('bar') { foo($_) }
Cheers,
Ovid