in reply to Re: Perl File Handle Count not working as expected, why?
in thread Perl File Handle Count not working as expected, why?
Although correct, this is not the issue here (the process group id and the process id are numerically the same in this case).
The real issue is that by creating a new $fh with
my $fh = new FileHandle();
the old handle will go out of scope, so the file is automatically being closed.
If you store away $fh somewhere, e.g.
my $fh = new FileHandle(); push @fhandles, $fh; # keep it from going out of scope ...
the file handle count will go up.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Perl File Handle Count not working as expected, why?
by radnus (Novice) on Jul 14, 2010 at 18:23 UTC |