$filename = "gump"; # get data on the file ($nsize,$time) = (stat($filename))[7,9]; #use the 7th & 9th items in the stat array # reformat the data ($s, $m, $h, $day, $mon, $yr) = (localtime($time))[0,1,2,3,4,5]; $size = &commas9($nsize); $h = &two_digits($h); $m = &two_digits($m); $s = &two_digits($s); $ntime = $h.":".$m.":".$s; $mon = (Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec)[$mon]; print "gump $day $mon $yr hh:mm:ss=$h:$m:$s\n"; sub two_digits { local ($_) = @_; if (length($_) == 0) { $_ = "00"; } elsif (length($_) == 1) { $_ = "0".$_; } elsif (length($_) > 2) { die "Supplied a number of more than 2 digits to two_digits\n"; } $_; } sub commas9 { local($_) = @_; 1 while s/(.*\d)(\d\d\d)/$1,$2/; while (length($_) < 9) { $_ = " ".$_; } $_; }