Exporter-Cluster-0.31/0040755000076400007640000000000007637533415015007 5ustar dhagemandhagemanExporter-Cluster-0.31/MANIFEST0100644000076400007640000000006707637533407016141 0ustar dhagemandhagemanChanges Cluster.pm Makefile.PL MANIFEST README t/use.t Exporter-Cluster-0.31/Cluster.pm0100644000076400007640000001063407637533407016770 0ustar dhagemandhagemanpackage Exporter::Cluster; ###################################################################### ## ## ## Package: Cluster.pm ## ## Author: D. Hageman ## ## ## ## Description: ## ## ## ## Exporter::Cluster is a module designed to work with Exporter ## ## to bundle or 'cluster' the importing of several modules. ## ## ## ###################################################################### ##==================================================================## ## Libraries and Variables ## ##==================================================================## require 5.005; ## This will be the earliest version of Perl we will ## consider supporting with this module. use warnings; $Exporter::Cluster::VERSION = "0.31"; ##==================================================================## ## Function(s) ## ##==================================================================## ##----------------------------------------------## ## import ## ##----------------------------------------------## ## Method that will be inherited by the module ## ## that puts Exporter::Cluster in this ISA. ## ##----------------------------------------------## sub import { my $self = shift; ## We need to find out who is calling us so we can use that ## as the destination of the symbol munging. my $caller = caller; ## Loop through all of the elements of the EXPORT_CLUSTER hash. foreach( keys( %{ "$self\::EXPORT_CLUSTER" } ) ) { ## Grab the arguments to pass into the import function. We ## clean them up a bit so they can pass nicely into our ## eval. my $arguments = join( ",", @{ ${ "$self\::EXPORT_CLUSTER" }{ $_ } } ); ## The magic happens here ... we require the package we are ## wanting to 'use', change our calling space and import ## the symbols into that calling space. eval "require $_; package $caller; $_->import( $arguments );"; ## If we have an error, go ahead and display it. die( @_ ) if ( @_ ); } return; } ##==================================================================## ## End of Code ## ##==================================================================## 1; ##==================================================================## ## Plain Old Documentation (POD) ## ##==================================================================## __END__ =head1 NAME Exporter::Cluster - Extension for easy multiple module imports. =head1 SYNOPSIS In module ModuleName.pm: package ModuleName; require Exporter::Cluster; @ISA = qw( Exporter::Cluster ); %EXPORT_CLUSTER = ( MODULE_1 => ARGS_1, MODULE_2 => ARGS_2, ... => ... ); In other files which to use ModuleName: use ModuleName; All of the modules listed %EXPORT_CLUSTER will be available (after being augmented by the import argument list if any) to the module that uses ModuleName. =head1 DESCRIPTION Exporter::Cluster is designed to allow the user to develop a binding package that allows multiple packages to be imported into the symbol table with single 'use' command. This module was created from the observation of the general trend of Perl packages growing in complexity as new technology is developed and Perl interfaces are designed to interact with this technology. This is not a general use module! It has been designed mainly for use by developers who are trying to implement a sane interface to their work, but still attempt to use good coding practices such as code seperation and modular design. =head1 BUGS No known bugs at this time. =head1 AUTHOR D. Hageman Edhageman@dracken.comE =head1 SEE ALSO L =head1 COPYRIGHT AND LICENSE Copyright (c) 2002-2003 D. Hageman (Dracken Technologies). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =cut Exporter-Cluster-0.31/t/0040755000076400007640000000000007637533415015252 5ustar dhagemandhagemanExporter-Cluster-0.31/t/use.t0100644000076400007640000000072407637533407016234 0ustar dhagemandhageman# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl 1.t' ######################### # change 'tests => 1' to 'tests => last_test_to_print'; use Test::More tests => 1; BEGIN { use_ok('Exporter::Cluster') }; ######################### # Insert your test code below, the Test::More module is use()ed here so read # its man page ( perldoc Test::More ) for help writing this test script. Exporter-Cluster-0.31/Changes0100644000076400007640000000107307637533407016301 0ustar dhagemandhagemanExporter::Cluster Revision History ================================== 0.31 Mon Mar 24 01:41:08 2003 - Silly mistake with "use strict". 0.30 Sun Mar 23 21:29:09 2003 - Change the version numbering scheme to something that perl likes a bit more. - A few documentation tweaks and consistency corrections. 0.2.5 Sat Jul 06 15:43:52 2002 - Removed code dependencies that required Perl 5.6.0 to allow the the module to work on older Perl versions. - Added some more documentation. 0.2.0 Wed Jun 19 00:18:55 2002 - First working version of Exporter::Cluster Exporter-Cluster-0.31/README0100644000076400007640000000251107637533407015664 0ustar dhagemandhagemanExporter::Cluster README ======================== I have noticed a general trend of Perl packages growing in complexity as new technology is developed and Perl modules are made to interface with these advances. Designing and developing an interface to these new interfaces can be (and most likely should be) a time consuming and thought intensive task. One of the hardest tasks is to use good coding practices of code separation in the Perl modules. If such practices are followed to the extreme, the end user might have to add quite large 'use' list at the top of each file. The goal of Exporter::Cluster is to implement a binding package that can reduce the list of closely associated modules down to one 'use'. This is not a general use module as its abuse can be considered 'bad programming', but rather it is intended for complex libraries or internal company use. INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module has no internal dependencies, but it has been designed to specifically work with modules that use the Exporter module. COPYRIGHT AND LICENSE Copyright (C) 2002-2003 D. Hageman (Dracken Technologies). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Exporter-Cluster-0.31/Makefile.PL0100644000076400007640000000102307637533407016753 0ustar dhagemandhagemanrequire 5.005; ## This is the earliest version of Perl that we ## will consider supporting. use ExtUtils::MakeMaker; WriteMakefile( 'NAME' => 'Exporter::Cluster', 'VERSION_FROM' => 'Cluster.pm', 'PREREQ_PM' => {}, ## No additional modules are required to ## make Exporter::Cluster work. ($] >= 5.005 ? ## We need to section this off for it to work with ## older versions of Perl. ( ABSTRACT_FROM => 'Cluster.pm', AUTHOR => 'D. Hageman ') : ()), );