"Sisyphus" <> wrote in message
news:46487224$0$27448$ u...
[..]
> require Exporter;
> @GD::3DBarGrapher::ISA = qw(Exporter);
> @GD::3DBarGrapher::EXPORT_OK = qw(creategraph);
>
> The module could then be loaded as:
>
> use GD::3DBarGrapher qw(creategraph);
>
> and the function creategraph() could be used - there would be no need for
> the "fully qualified" name. (See 'perldoc Exporter' for full
> details/options.)
>
> You don't really need Exporter at all - it's just a convenience that's
> usually provided, so that users can call (for example) the creategraph
> function as 'creategraph()' instead of having to write
> 'GD::3DBarGrapher::creategraph()'
That's excellent thanks - I think I was getting bogged down thinking I
needed to call a "new" instance of the module and then set the config
options via object handles etc, but I can see I don't need all that.
I set up 3DBarGrapher.pm as you suggested, including the exporter and a
test.pl file, and it works nicely
> And you'll want to designate a version number:
>
> $GD::3DBarGrapher::VERSION = '0.01'; # or whatever number you want
Is there any general guide on version numbers? That is, I don't at present
have a to-do list for enhancements to it, so would be inclined to call it
version 1.0. However, I notice alot of modules seem to be 0.xx.
> To create a proper CPAN distro, you'll also need a Makefile.PL, a CHANGES
> file , a README file , and a test suite (or at least a test.pl) to ensure
> that things are working as expected.
I found this page:
http://cpan.uwinnipeg.ca/htdocs/perl/perlnewmod.html and
so have requested a Pause account. It mentions using things like
make-starter or hx2s. I tried the latter but it puts alot of complicated
stuff into the .pm template and creates some other similarly mysterious
files. I will try make-starter when I get my Pause account & cpan email. But
if I just created the files you mention manually, then presumably I would
just pack them into a tarball and upload?
Regards
Ian