in reply to need help with comparing time..

I don't see how the code you posted is relevant. You can use arithmetic on seconds if you don't care about timezones, daylight saving times, leap seconds etc.
#! /usr/bin/perl use warnings; use strict; use Time::Piece; my $last_modified = 'Time::Piece'->strptime('2015-05-20 03:52:13', '%Y +-%m-%d %H:%M:%S'); my $diff = -($last_modified - localtime) / 60 / 60; print $diff < 12 ? 'less' : 'more (or equal)', " than 12 hours\n";

See also DateTime and Date::Manip.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ