in reply to How to get an integer sub string between two string

What do you see as problematic with your current approach?

Maybe you want to use a regular expression instead?

$line =~ /\b(\d\d:\d\d:\d\d)\b/ or die "No time in '$line'"; my $time= $1;