in reply to Re^2: I am a beginner in perl,not able to get the output for the following
in thread I am a beginner in perl,not able to get the output for the following

The naive way of doing this is by calculating the number of seconds since the epoch using timelocal for both moments and then subtracting the smaller from the bigger. That will give you the difference in seconds between the two moments. However, you may run into problems with Daylight Saving Time and such.

If you really need to have the exact calculations taking into account different timezones and all kind of "specials", use DateTime.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

  • Comment on Re^3: I am a beginner in perl,not able to get the output for the following
  • Download Code