in reply to Re: use Date::Calc qw(Delta_Days)
in thread use Date::Calc qw(Delta_Days)

No error. It just terminates.

Replies are listed 'Best First'.
Re^3: use Date::Calc qw(Delta_Days)
by jeffa (Bishop) on Jul 23, 2004 at 12:51 UTC

    Just a long shot, but try this:

    eval { $self->Fetch($key, !$Win32::OLE::Strict); }; print $@;
    By wrapping the expression in eval, any die's that might have been issued will be trapped and you can inspect the reason why in $@.

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
Re^3: use Date::Calc qw(Delta_Days)
by gellyfish (Monsignor) on Jul 23, 2004 at 12:50 UTC

    than perhaps some of the surrounding code might be useful, as it is not clear at all what you are trying to do

    /J\

      use Date::Calc qw( Delta_Days );

      ...

      my $enddate = MetaLink::getField('END_DATE'); # $enddate equals '03/22/2006' (a string)

      my $startdate = MetaLink::getField('START_DATE'); # $enddate equals '03/22/2002' (also a string)

      ...

      my ($sdd, $smm, $syyyy) = ($startdate =~ /(\d+)\/(\d+)\/(\d+)/);

      my ($edd, $emm, $eyyyy) = ($enddate =~ /(\d+)\/(\d+)\/(\d+)/);

      my $days = Delta_Days($syyyy, $smm, $sdd, $eyyyy, $emm, $edd);

      When the last line is stepped through, the program jumps to:

      package Win32::OLE::Tie;

      # Only retry default method under C<no strict 'subs';>

      sub FETCH {

          my ($self,$key) = @_;

          if ($key eq "_NewEnum") {

              (my $class = ref $self) =~ s/::Tie$//;

              return [Win32::OLE::Enum->All($self)] if <p><code>        ${"${class}::_NewEnum"};

      }

          $self->Fetch($key, !$Win32::OLE::Strict);

      }

      The if ($key eq "_NewEnum") is false and the programm terminates (abruptly) on the line $self->Fetch($key, !$Win32::OLE::Strict);