=pod

=head1 NAME

Package::Autoloader::Generator::Export - on-demand export

=head1 SYNOPSIS

	use strict;
	
	package Synopsis;
	use Package::Autoloader sub{eval shift}, sub {
		$_[0]->register_rule('::Export', '::*', ['hello_world', 'yn']);
	};
	
	sub hello_world() { print "Hello World.\n"; };
	sub yn() { print STDERR ($_[0] ? 'Yes' : 'No'), "\n"; };

	
	package Synopsis::Ex1;
	use Package::Autoloader sub{eval shift};
	
	yn(!defined(&hello_world));
	yn(potentially_defined('hello_world'));

	hello_world();

	yn(defined(&hello_world));
	exit(0);
	
=head1 DESCRIPTION

Takes the requested subroutine from the defining package. Makes no sense with '=' wildcard.

Set this package global to allow the generator to eventually trigger other generators. Nothing wrong with that, it just exists to highlight what to look for when writing generators.

$Package::Autoloader::Generator::Closures_Demo::ONLY_DEFINED_ORIGINALS = 0;

=head2 Prototypes

Prototype definitions are not supported. Although the rule could see which subroutines are for export in the defining package, get their prototype definition with prototype() and submit a prototype to each requesting package. This is unlikely to be implemented unless prototypes are honored for AUTOLOADed subroutines.


=head1 ANYTHING ELSE

Please see the documentation of the upstream package L<Package::Autoloader>.

=cut
