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


in reply to Using the Substr

Is substr mandatory? Or can you use a regex, like

$string =~ /^(\d+:\d+:\d+):/; $result = $1;
(assuming there are only digits between the colons).

HTH, Rata