Skip to content

Instantly share code, notes, and snippets.

@hfs
Created March 25, 2013 16:21
Show Gist options
  • Save hfs/5238365 to your computer and use it in GitHub Desktop.
Save hfs/5238365 to your computer and use it in GitHub Desktop.
Prepend the current timestamp in ISO8601 format in front of every line of output. Separator is an optional parameter, default is tab.
#!/usr/bin/perl -p
use POSIX;
BEGIN {
$| = 1;
$separator = shift or $separator = "\t";
}
print strftime("%Y-%m-%dT%H:%M:%S", localtime), $separator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment