I've got two questions about the Perl open command:
1) I seem to remember from Perl Best Practices that the 3 argument version of open is better than the two argument version, e.g.
open(OUT, '>>', $file);
vs.
open(OUT, ">>$file");
Why is that? I was trying to tell somebody to use the 3 argument version the other day but couldn't seem to back it up with anything.
2) I also seem to remember lexical file handles being favored over non-lexical file handles (they called something different)? And also couldn't remember why, e.g.
open(my $out, '>>', $file);
vs.
open(OUT, '>>', $file);
Is it a strict
thing? I seem to remember being able to use OUT
with strict
but I can't remember.
Thanks, and sorry for asking two questions in one.