in reply to Re: Date::Manip can't get Date_Cmp to work
in thread Date::Manip can't get Date_Cmp to work

You're using Date::Manip::Date objects as inputs to a Date::Manip function

Ah. I thought they were some kind of fungible generic date objects.

You want

my $flag = $date1->cmp($date2);

Oops. I didn't see that function in Date::Manip::Date. Yep, that worked.

Thanks

Replies are listed 'Best First'.
Re^3: Date::Manip can't get Date_Cmp to work
by ikegami (Patriarch) on Apr 01, 2010 at 05:28 UTC

    Date::Manip doesn't use objects at all.

    use strict; use warnings; use Data::Dumper; use Date::Manip; use Date::Manip::Date; { my $date = ParseDate("today"); print(Dumper($date)); } { my $date = Date::Manip::Date->new(); $date->parse_format("%Y--%m--%d", "2010--03--30") and die; local $Data::Dumper::Maxdepth = 1; print(Dumper($date)); }
    $VAR1 = '2010040100:00:00'; $VAR1 = bless( { 'err' => '', 'args' => 'ARRAY(0x20170a4)', 'data' => 'HASH(0x218b084)', 'objs' => 'HASH(0x239064)' }, 'Date::Manip::Date' );