in reply to Converting to epoch time.

There's no need to reinvent any part of this wheel. Time::Piece:

use Time::Piece; my $str = '2005-03-28 12:00:00'; my $fmt = '%Y-%m-%d %H:%M:%S'; print Time::Piece->strptime($str,$fmt)->epoch; __END__ 1112011200

There are many other handy shortcut methods as well...

hth