http://qs321.pair.com?node_id=278698


in reply to Null in Array

Checking the length seems to be a waste. Just test the variable directly w/ a regexp. I might do something closer to:
print (($day[5] =~ /^\d{2}:\d{2}:\d{2}$/) ? $day[5] : '00:00:00');
NB: TMTOWTDI. Code is untested. Regexp used may not be correct, but it's tough to tell without context.