in reply to Epoch Conversion
my $date = shift || '12/DEC/2001:17:23:09';
The means you can enter a value on the command line without having to edit your script, and if nothing is supplied a default value will be used.
The creation of the %month hash is better written using the pair operator =>. Also, since you never modify it, it is even better to define it as a constant. And finally, through the wonders of human perception finding it easier to scan columns, the betterer way would be something like:
use constant MONTH => { Jan => 1, Apr => 4, Jul => 7, Oct => 10, Fen => 2, May => 5, Aug => 8, Nov => 11, Mar => 3, Jun => 6, Sep => 9, Dec => 12, }; ... my $mon = MONTH->{$mon};
Minor usability quibble: programs that gratuitously clear the screen make me want to reach for the bazooka. Don't do it, or at least do it in a portable way, and don't do it if the code is not being run from a tty.
--
|
|---|