Help for this page

Select Code to Download


  1. or download this
    #hash slice with a range
    my %months;
    @months{1..12} = qw/Jan Feb Mar Apr
                        May Jun Jul Aug
                        Sep Oct Nov Dec/;
    
  2. or download this
    sub get_days {
        my $month = shift;
    ...
        return 29 if $month eq '2';
        die "Bad month entered!\n";
    }