in reply to Regular expression and lexical variables

Another way to check:
while (<DATA>) { my ($hours, $minutes, $seconds) = /(\d\d):(\d\d):(\d\d)/ or next; print "$hours,$minutes,$seconds\n" }