sub foo { my @time_vec = @_ > 1 ? @_ : defined $_[0] ? localtime($_[0]) : localtime; return strftime('%Y-%m-%d %H:%M:%S', @time_vec); }