Next Trivial Utilities 27

localtime

        #!/usr/bin/perl
        if (@ARGV) {
          for (@ARGV) {
            print show_localtime($_), "\n";
          }
        } else {
          while (<>) {
            s/^(\d+)/show_localtime($1)/e;
            print;
          }
        }
        sub show_localtime {
          my $t = shift;
          scalar localtime $t;
        }


Next Menu Copyright © 2012 M. J. Dominus