my $ts_fmt = 'MMM DD HH:MM:SS '; my $line = 'Feb 18 00:12:14 foo bar bat baz fwa'; my $time = substr($line, 0, length $ts_fmt, ''); chop $time; # pesky space.. # $time is the time part. # $line holds the part after the time is removed.