foreach (@lines) { my($month, $day, $time, $data1, $data2) = split / /; open(NEWTIME, $time); #### while () { #### my($hour, $minute, $second) = split /:/; $time2 = join(':', $hour, $minute); } #### select NEWLOG; print "$time2\n"; #### open NEWLOG, ">>foofinal.txt"; }