use POSIX 'strftime'; sub get_day_name { my ( $day, $month, $year ) = @_; my $week_day = strftime '%w', 0, 0, 0, $day, $month - 1, $year; return ( qw( So Mo Di Mi Do Fr Sa ) )[ $week_day ]; }