in reply to date difference

Why you don't want to use the module?

What prevents you from using it? Tell us and we may have the solution

What prevents you from using the code from the module, with Author's permission? In other words, why we should think for you and not spend our time in thinking something new and more important?

Replies are listed 'Best First'.
Re^2: date difference
by raghvens (Novice) on Oct 08, 2009 at 09:36 UTC

    Hi,

    Now I have modified the script as shown below. I am using for the first time, Please be kind to forgive mistakes.

    use Date::Calc qw(Delta_YMD); @date = localtime(); open(LOG, ">veiwreport.txt") or print die $!; @vlist = "raghavr_view11"; foreach(@vlist) { @viewdetails = `cleartool lsview -prop -full $_`; } foreach $vd (@viewdetails) { if ($vd =~ m/Last accessed/) { @details = split(/\s+/,$vd); $accdet = $details[2]; @acc = split(/T/,$accdet); chomp(@acc[0]); print "\nLast accessed : @acc[0]"; print LOG "\t Last accessed : @acc[0]"; $ac=@acc[0]; @ac = split(/\-/,$ac); $year1=@ac[0]; $month1=@ac[1]; $day1=@ac[2]; } if ($vd =~ m/Created/) { @a = split(".",$vd,1); @b = split("T",@a[0]); $b[0] =~ s/(\w)*/ /; $b[0] =~ s/\s+//; print " created on $b[0]"; print LOG " created on $b[0]"; $crd=@b[0]; @cd = split(/\-/,$crd); $year2=@cd[0]; $month2=@cd[1]; $day2=@cd[2]; } $diff = Delta_YMD($year1,$month1,$day1, $year2,$month2,$day2); print "Age of the $vd view is $diff \n"; }

    First of all, I am getting the error: Date::Calc::Delta_YMD(): not a valid date at rs.pl line 60. Please suggest, as I am really struck here.

Re^2: date difference
by raghvens (Novice) on Oct 09, 2009 at 10:49 UTC
    Hi, Sorry for the late response, I was not well. Yes, previously I had access problem on the server and installation of perl module on the server, but now I am permitted for the installation of perl modules. So now kindly suggest how to use the modules.

      Yes, even you can use CPAN

      Alexander

      --
      Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)