in reply to Re: Bareword "SEEK_END" not allowed while "strict subs" in use
in thread Bareword "SEEK_END" not allowed while "strict subs" in use
Using bareword symbols to refer to file handles is particularly evil because they are global, and you have no idea if that symbol already points to some other file handle. You can mitigate some of that risk by localizing the symbol first
It isn't particularly hard to grep for "FH" being used elsewhere in the current package. And local doesn't actually mitigate that risk much unless you only use the file handle for the duration of some short-lived subroutine (and there are no subroutines in the original code).
Oh, and it was 5.6.1 where "open my $fh" became supported. :)
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Bareword "SEEK_END" not allowed while "strict subs" in use (FH)
by Monk::Thomas (Friar) on May 13, 2014 at 15:16 UTC | |
by tye (Sage) on May 13, 2014 at 15:21 UTC | |
by Monk::Thomas (Friar) on May 13, 2014 at 16:36 UTC | |
by ikegami (Patriarch) on May 14, 2014 at 15:07 UTC |