I can't replicate the problem here. How about simplifying the algorithm instead?
sub minutes_before
{
my $minutes_b4=shift;
my $month=shift;
my $day=shift;
my $hour=shift;
my $minute=shift;
# Lets find n minutes before!
my $datetime=DateTime->new( year => 2005,
month => month_to_num($month),
day => $day,
hour => $hour,
minute => $minute,
second => 00 );
$datetime->subtract( minutes => $minutes_b4 );
$ready=1;
return @MINBEFORE = (
num_to_month( $datetime->month ),
$datetime->day,
$datetime->hour,
$datetime->minute );
}