in reply to grabbing time from a syslog logfile

If you like cut at the command line, try substr in Perl:
my $hour = substr $msg_content[-1], 8, 2;
This says to store 2 characters beginning at position 8 of the last line in the file into the new variable $hour. There are many other ways to accomplish this.

How to read the last line in the file is more interesting. Above, it looks like you are willing to read the whole file into memory. That's good enough, if your syslog doesn't grow too large.

Phil