#!/usr/bin/env perl
#
# tims - timestamp stdin and then print to stdout and flush

use strict;
use warnings;
use POSIX qw(strftime);
use IO::Handle;
STDOUT->autoflush(1);

while (<STDIN>) {
    my $now = time;
    my $tz  = strftime( ( '%z', ( localtime $now ) ) );
    $tz =~ s/(\d{2})(\d{2})/$1:$2/smx;
    my $time = strftime( '%Y-%m-%dT%H:%M:%S', ( localtime $now ) );
    print "$time$tz " . $_;
}
