Skip to content

Commit

Permalink
add export variables
Browse files Browse the repository at this point in the history
  • Loading branch information
stevan committed Jun 13, 2016
1 parent 3c36fa5 commit a1383c7
Showing 1 changed file with 39 additions and 1 deletion.
40 changes: 39 additions & 1 deletion mop/lib/mop/module.pm
Expand Up @@ -58,6 +58,29 @@ sub authority {
return $$authority;
}

# exports

sub export {
my ($self) = @_;
my $export = mop::internal::util::GET_GLOB_SLOT( $self->stash, 'EXPORT', 'ARRAY' );
return unless $export;
return @$export;
}

sub export_ok {
my ($self) = @_;
my $export_ok = mop::internal::util::GET_GLOB_SLOT( $self->stash, 'EXPORT_OK', 'ARRAY' );
return unless $export_ok;
return @$export_ok;
}

sub export_tags {
my ($self) = @_;
my $export_tags = mop::internal::util::GET_GLOB_SLOT( $self->stash, 'EXPORT_TAGS', 'HASH' );
return unless $export_tags;
return %$export_tags;
}

# closed-ness

sub is_closed {
Expand Down Expand Up @@ -135,7 +158,22 @@ mop::module - a more structured `package`
The idea of a module is really just a formalized convention for
using packages. It provides ways to access information (name,
version, authority) as well as adds two concepts.
version, authority and exports) as well as adds two concepts.
=over 4
=item C<$VERSION>
=item C<$AUTHORITY>
=item C<@EXPORT>
=item C<@EXPORT_OK>
=item C<%EXPORT_TAGS>
=back
=head2 Closing a module
Expand Down

0 comments on commit a1383c7

Please sign in to comment.