in reply to Convert Old Unix Date to Perl and compare

Untested:
if (my($year, $mon, $day, $hour, $min) = $file =~ /Rajesh\.([0-9]{2})( +[0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})/) { my $unixtime = mktime(0, $min, $hour, $mon - 1, $year + 100, 0, 0) +; ... }

Replies are listed 'Best First'.
Re^2: Convert Old Unix Date to Perl and compare
by thargas (Deacon) on Feb 27, 2012 at 18:19 UTC
    shouldn't it be timelocal() from Time::Local instead of mktime()? Or you could use POSIX qw(mktime) instead, but POSIX is a lot to bring in just for this.
      The OP was using mktime, indicating his problem was extracting the pieces of data from the filename, not with the construction of the time. Who am I to second guess him?
Re^2: Convert Old Unix Date to Perl and compare
by FloydATC (Deacon) on Feb 27, 2012 at 14:16 UTC
    In this case, $year is already in "year-1900" format so that value can be used as is.

    I'm assuming you meant +1900 and not +100 since that makes no sense at all?

    Edit: Nevermind me. I just woke up.

    -- Time flies when you don't know what you're doing