{{$NEXT}}
- Make Sub::Exporter an optional dep (which is kinda the whole point)
+ - warning about too complex usage of Sub::Exporter::Progressive is now
+ an exception
0.001001 2012-07-29 19:58:40 America/Chicago
- Fix '-all' option for the default group
my $inner_target = caller(0);
my ($TOO_COMPLICATED, $export_data) = sub_export_options(@args);
- if ($TOO_COMPLICATED) {
- warn <<'WARNING';
+ die <<'DEATH' if $TOO_COMPLICATED;
You are using Sub::Exporter::Progressive, but the features your program uses from
Sub::Exporter cannot be implemented without Sub::Exporter, so you might as well
just use vanilla Sub::Exporter
-WARNING
- require Sub::Exporter;
- goto \&Sub::Exporter::import;
- }
- else {
- my $full_exporter;
- no strict;
- @{"${inner_target}::EXPORT_OK"} = @{$export_data->{exports}};
- @{"${inner_target}::EXPORT"} = @{$export_data->{defaults}};
- *{"${inner_target}::import"} = sub {
- use strict;
- my ($self, @args) = @_;
-
- if (first { ref || !m/^\w+$/ } @args) {
- die 'your usage of Sub::Exporter::Progressive requires Sub::Exporter to be installed'
- unless eval { require Sub::Exporter };
- $full_exporter ||=
- Sub::Exporter::build_exporter($export_data->{original});
-
- goto $full_exporter;
- } else {
- require Exporter;
- goto \&Exporter::import;
- }
- };
- }
+DEATH
+
+ my $full_exporter;
+ no strict;
+ @{"${inner_target}::EXPORT_OK"} = @{$export_data->{exports}};
+ @{"${inner_target}::EXPORT"} = @{$export_data->{defaults}};
+ *{"${inner_target}::import"} = sub {
+ use strict;
+ my ($self, @args) = @_;
+
+ if (first { ref || !m/^\w+$/ } @args) {
+ die 'your usage of Sub::Exporter::Progressive requires Sub::Exporter to be installed'
+ unless eval { require Sub::Exporter };
+ $full_exporter ||=
+ Sub::Exporter::build_exporter($export_data->{original});
+
+ goto $full_exporter;
+ } else {
+ require Exporter;
+ goto \&Exporter::import;
+ }
+ };
}
sub sub_export_options {