June 2001 Making a Module Back Slide 8 Forward

@EXPORT

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 by default. They will pollute the name space of the package that calls this module and can be called without a package name
  • Give a Hoot, Don't Pollute. Only export by default those things that really need it.


Copyright © 2001 R. Geoffrey Avery Back Contents Forward