while (<>) {
if ( not /\|/ ) {
warn "bad data line: $_";
next;
} # if no pipe
chomp;
my ($whoknows, $oneletter, $date_str ) = split(/\|/);
if ( not defined( $date_str ) ) {
warn "bad data line - no date string: $_";
next;
} # if no date
if ( length($date_str) != 6 ) {
warn "bad data line - bad date string format ($date_str): $_";
next;
} # if no date
if ( $date_str =~ /[^\d]/ ) {
warn "bad data line - bad date string ($date_str): $_";
next;
} # if date_str has non-digit
my ($year, $month, $day ) = $date_str =~ /(..)(..)(..)/;
# y2k problem?
$year += 2000;
printf("%02d/%02d/%d\n", $month, $day, $year);
}
a
Andy Bach
Systems Mangler
Internet: [EMAIL PROTECTED]
VOICE: (608) 261-5738 FAX 264-5932
"CM/ECF is a complex unfinished suit. Pull on a loose cuff thread and
your pants fall down." MEC
_______________________________________________
Perl-Unix-Users mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs