>I've just written a calendar creating module, Date::Calendar 1.0. It 
>requires Steffen Beyer's Date::Calc. (Thomas Wenger's Mac port of 
>Date::Calc 4.3 can be downloaded from
>    http://usemacperl.webjump.com/downloads/Date-Calc-4.3-bin-MacOS.tar.gz)
>
>My Date::Calendar can be downloaded from
>    http://personal.bgsu.edu/~norton/download/datecalendar10.sit (Mac)
>or
>    http://personal.bgsu.edu/~norton/download/Date-Calendar-1.0.tar.gz (UNIX)
>
>This is my first Perl module. If anyone is interested in trying it 
>out, I'd very much like to hear your comments.
>
>Regards,
>
>Vic

Hi Vic,

cool, works great here. However, you should definitely beef this up 
to a full featured module distribution (take a look at 
perlmodlib.pod). It's quite easy. Usually, one will start to create a 
module by running the h2xs tool. This tool generates templates for 
all files needed for a module distribution (Calendar.pm, Changes, 
Makefile.PL, MANIFEST, test.pl). Unfortunately, h2xs is not part of 
the standard distribution (at least, I can't find it there), only 
part of the source distribution and part of the Mac XS tutorial 
(because it's also used for extension modules) [1]. The XS tutorial 
distribution contains a Mac version of h2xs called mac_h2xs, which 
can be run from the MPW command line, in your case:

    perl mac_h2xs -X -v 1.0 -n Date::Calendar

and creates the mentioned files. However, if you haven't installed 
MPW, the XS tutorial also contains a GUI droplet that runs with the 
MacPerl app. After mac_h2xs has created the files, the Makefile.PL 
should look like this:

use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
     'NAME'     => 'Date::Calendar',
     'VERSION_FROM' => 'Calendar.pm', # finds $VERSION
);

__END__

The only thing you have to do now, is to write some tests and put 
them in the test.pl file. With the provided Makefile.PL , the 
installme.plx installer will install your module properly.

Btw, a quick glance at the SYNOPSIS showed a little error:
   month_block
     $mblock = mblock($year,$month);
should be
     $mblock = month_block($year,$month);


Best regards,

--Thomas

[1] http://macperl.com/depts/Tutorials/XS/Mac_XS.sea.hqx

Reply via email to