in reply to Month '-1' out of range 0..11

swissknife,
Have you checked the values are what you think they are?
print "$sec, $min, $hour, $mday, $mon, $year\n";
There are many more comments unrelated to your problem I could make: But I am betting you will solve your problem simply by inspecting the values of your variables.

Cheers - L~R

Replies are listed 'Best First'.
Re^2: Month '-1' out of range 0..11
by swissknife (Sexton) on Mar 18, 2014 at 16:54 UTC

    I think issue is because of readdir read hidden files as well, which are then used in sub and it failes. what can be done to ignore hidden files in readdir?

      swissknife,
      I think issue is because of readdir read hidden files as well, which are then used in sub and it failes. what can be done to ignore hidden files in readdir?

      Why are you guessing? I suggested printing the values because there is a pretty big hint they aren't what you think they are. You should also print the file name (filetoread) and know that is your problem before taking action.

      Cheers - L~R

        No i am not guessing. This is what i found when i ran this program in debug mode. With the use of Regex, i was able to restrict the . and .. file to get passed in sub UtctoLocal and now it does what i want. Thanks for help.