package MyExporter; use Exporter (); BEGIN { our @ISA = 'Exporter'; } sub import { our @EXPORT_OK; our @EXPORT_TAGS; #my $pkg = \%::; #$pkg = $pkg->{$_} foreach ((caller().'::') =~ /\G(.*::)/g); my $pkg = caller() . '::'; { no strict 'refs'; $pkg = *$pkg; } local *EXPORT_OK = $pkg->{'EXPORT_OK'}; local *EXPORT_TAGS = $pkg->{'EXPORT_TAGS'}; { # Expand tag names into referenced name sets my %seen; $EXPORT_TAGS{all} = [ grep { !$seen{$_}++ } map { m/^:(.*)$/ ? @{$EXPORT_TAGS{$1}} : $_ } @{$EXPORT_TAGS{all}} ]; } { # Add tag set names not already listed into @EXPORT_OK my %seen; $seen{$_}++ foreach @EXPORT_OK; push @EXPORT_OK, grep { !$seen{$_}++ } @{$EXPORT_TAGS{$_}} foreach keys %EXPORT_TAGS; } &Exporter::import; } #### package LISConst; use vars qw($VERSION @ISA %EXPORT_TAGS); require MyExporter; @ISA = qw(MyExporter); $VERSION = '0.01'; %EXPORT_TAGS = ( hdr_lens => [qw( LIS_TIF_HDR_LEN LIS_TIF_HDR_DATA_MAX LIS_PHY_HDR_LEN LIS_LR_HDR_LEN )], phyhdr_flags => [qw( . . . . )], lr_types => [qw( . . . . )], );