in reply to grabbing time from a syslog logfile
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.my $hour = substr $msg_content[-1], 8, 2;
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
|
|---|