3 # The Oogaboogoo natives on the island have unusual names for the days and
4 # months. Here is some simple but not very well-written code from Gilligan.
5 # Fix it up, add a conversion function for the month names, and make the
6 # whole thing into a library. For extra credit, add suitable error checking
7 # and consider what should be in the documentation.
9 # @day = qw(ark dip wap sen pop sep kir);
10 # sub number_to_day_name { my $num = shift @_; $day[$num]; }
11 # @month = qw(diz pod bod rod sip wax lin sen kun fiz nap dep);
20 my @day = qw(ark dip wap sen pop sep kir);
21 my @month = qw(diz pod bod rod sip wax lin sen kun fiz nap dep);
22 sub number_to_day_name {
24 die "Invalid day number" if $num >= 7 or $num < 0;
27 sub number_to_month_name {
29 die "Invalid month number" if $num >= 12 or $num < 0;