June 2001 Making a Module Back Slide 9 Forward

@EXPORT_OK

package Sample::Module;
use strict;

BEGIN{
  use Exporter ();
  use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
  $VERSION     = 0.01;
  @ISA         = qw (Exporter);
  @EXPORT      = qw ();
  @EXPORT_OK   = qw ();
  %EXPORT_TAGS = ();
}

#Everything else goes here

1;
__END__

  • Functions and Variables here are exported only if requested.
  • Otherwise they can still be used, but you must give the full name like $Sample::Module::Foo
  • my variables can not be exported, must use vars


Copyright © 2001 R. Geoffrey Avery Back Contents Forward