Randal L. Schwartz wrote:

my $first_free = do { open my $x, ">&STDERR"; fileno $x };
Yes, it's not the same as the number currently in use, but it's a
cheap number to get.



If you're on Linux (or Solaris IIRC) you could always use:

 my $num_fh = $#{[</proc/$$/fd/*>]}+1;

Hmm, lovely piece of line noise that.

Sam.

Reply via email to