in reply to Reading the last character of a file and/or line.
It does *not* take a character as an argument and search for that character.
Your friend was right--you're going to have to use seek and read. Try
Of course, if the last character of your file is actually a carriage return, this won't work; in that case, you'll needseek FH, -1, 2; read FH, $char, 1; if ($char eq "#") { ...
seek FH, -2, 2;
|
|---|