I\'ve got two questions about the Perl open function:
1) I seem to remember from Perl Best Practices that the 3-argument version of open<
Tackling #2:
OUT is a global filehandle and using it exposes you to insidious bugs like this:
sub doSomething {
my ($input) = @_;
# let's compare $input to something we read from another file
open(F, "<", $anotherFile);
@F = ;
close F;
&do_some_comparison($input, @F);
}
open(F, "<", $myfile);
while () {
&doSomething($_); # do'h -- just closed the F filehandle
}
close F;