On Tue, Mar 20, 2001 at 11:40:18AM -0500, Dave Cross wrote:
> I really think I should drop the author a polite note offering him a 
> patch or three.

A patch? It needs taking outside and shooting!

package Date::MMDDYY;
use strict;
use vars qw(@ISA @EXPORT_OK);
require Exporter;
@ISA = qw(Exporter);
@EXPORT_OK='datecon';

use POSIX 'strftime';

sub datecon {
    my ($time, $format, $delim) = @_;
    $time   = time()     if !defined $time;
    $format = 'MM,DD,YY' if !defined $format;
    $delim  = '-'        if !defined $delim;

    for ($format) {
        s:,:$delim:g;
        s:(MM|DD|YY):"%".lc(substr($1,0,1)):eg;
    }
    return strftime($format, localtime($time));
}


Should we also do a series of drop-in replacements for
crappy CPAN modules? ;-)

 .robin.

-- 
Straw? No, too stupid a fad! I put soot on warts.

Reply via email to