in reply to days between dates

Maybe $dte1 is not what you think. Check:

    my($dte,$dte1)= @_;

try with:

my $dte = $_[0]; my $dte1 = $_[1]; print "dte is :",$dte," and dte1 is: ",$dte1;