sub isleap { my ($year) = @_; return 1 if (( $year % 400 ) == 0 ); # 400's are leap return 0 if (( $year % 100 ) == 0 ); # Other centuries are not return 1 if (( $year % 4 ) == 0 ); # All other 4's are leap return 0; # Everything else is not } sub isLeap { my $Y=shift; return $Y % 400 ?( $Y % 100 ?( $Y % 4 ? 0 : 1 ): 0 ): 1; } =head1 C explained Get it? What else is there to explain ;)(it's isleap reduced to using ?:) =cut for my $year( 1980..1994) { printf "%10.10s | %s | %s\n", $year, isleap( $year ), isLeap( $year ); } __END__ 1980 | 1 | 1 1981 | 0 | 0 1982 | 0 | 0 1983 | 0 | 0 1984 | 1 | 1 1985 | 0 | 0 1986 | 0 | 0 1987 | 0 | 0 1988 | 1 | 1 1989 | 0 | 0 1990 | 0 | 0 1991 | 0 | 0 1992 | 1 | 1 1993 | 0 | 0 1994 | 0 | 0 and now for the butter __END__ E:\new\Date-Leapyear-1.71>ls ChangeLog LICENSE MANIFEST Makefile.PL Makefile.old README lib t E:\new\Date-Leapyear-1.71>perl Makefile.PL Checking if your kit is complete... Looks good Writing Makefile for Date::Leapyear E:\new\Date-Leapyear-1.71>nmake Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. cp lib/Date/Leapyear.pm blib\lib\Date\Leapyear.pm E:\new\Date-Leapyear-1.71>nmake test Microsoft (R) Program Maintenance Utility Version 6.00.8168.0 Copyright (C) Microsoft Corp 1988-1998. All rights reserved. C:\Perl\bin\perl.exe -Mblib -IC:\Perl\lib -IC:\Perl\lib -e "use Test::Harness qw(&runtests $verbose); $verbose=0 ; runtests @ARGV;" t\00load.t t\01isleap.t t\02testmore.t Using E:/new/Date-Leapyear-1.71/blib t\00load........ok t\01isleap......ok t\02testmore....ok All tests successful. Files=3, Tests=764, 0 wallclock secs ( 0.00 cusr + 0.00 csys = 0.00 CPU) E:\new\Date-Leapyear-1.71>cat MANIFEST lib/Date/Leapyear.pm MANIFEST Makefile.PL README ChangeLog LICENSE t/00load.t t/01isleap.t t/02testmore.t E:\new\Date-Leapyear-1.71>cat Makefile.PL 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::Leapyear', 'VERSION_FROM' => 'lib/Date/Leapyear.pm', # finds $VERSION 'PREREQ_PM' => { 'Test::More' => 0, }, # e.g., Module::Name => 1.1 ); E:\new\Date-Leapyear-1.71>