http://www.perlmonks.org?node_id=983912


in reply to Re^2: Time matching YYYY-MM-DD HH:MM:SS.SSS
in thread Time matching YYYY-MM-DD HH:MM:SS.SSS

Well, I asked for code and data that demonstrates the inconsistency; you didn't show any data.

Having said that, your code is ... well .. just God-awful.

It violates just about every rule of good coding practice and style going. I haven't the will to go though a complete list (maybe some other kind soul will have the patience), but just for starters:

Add

use warnings; use strict;
at the start of your code. You will be amazed!

The two-arg form of open is frowned upon. The one-arg form is vomit inducing.

In your second branch, you have $i = $i++; which is definitely not what you need, and may in fact be the cause of all your issues.

Dave.