Just a few things that come to mind:
- if ($port =~ /\-/) {...} can be replaced by $port =~ s/\-//g;
- you can simply push @Data, [$Time, $mth, $val, $value];
- It may be faster to do ($year, $month, $day) = (substr($date, 0, 4), substr($date, 4, 2), substr($date, 6)); to split the date
- if $Conf[7] seems to be set outside the while, so you could go for a simpler if statement rather than do the same regex each 1.5 million times through the loop or even forego the conditional statement in the loop completely
- you might have a look at the various Date and Time modules on CPAN that might do a faster job on date/time conversions
Hope this helps, -gjb-