Code:
package MyModule; use strict;
use Exporter;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
$VERSION = 1.00;
@ISA = qw(Exporter);
@EXPORT = ();
@EXPORT_OK = qw(&func1 &func2);
%EXPORT_TAGS = ( DEFAULT => [qw(&func1)],
Both => [qw(&func1 &func2)]);
sub func1 { return reverse @_ }
sub func2 { return map{ uc }@_ }
1;
I just found this example for using functions with my new package (Brand new to this BTW).
I guess I am looking for a generic format for creating a module which has a load of functions
I want to share with my other perl modules and cgi.
My question is, does the %EXPORT_TAGS in the above example suit the normal/best way to
share the functions in this file.
Also, I don't follow the use of DEFAULT or BOTH :
%EXPORT_TAGS = ( DEFAULT => [qw(&func1)],
Both => [qw(&func1 &func2)]);
Should I just ignore the DEFAULT line and use the both line for a generic form for inlcuding multiple functions?
use MyModule qw(:Both);
print func1(@list),"\n";
print func2(@list),"\n";
I aplogise for sounding lost... I just started dabbling in this a half hour ago (thanks Paul)
http://www.iuni.com/...tware/web/index.html
Links Plugins