Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: "Too Many Files Open" problem

by Marshall (Abbot)
on Jan 07, 2012 at 04:43 UTC ( #946716=note: print w/replies, xml ) Need Help??

in reply to "Too Many Files Open" problem

It appears to me that you are hitting an OS restriction on open files (not only OS specific, but also installation specific of that OS).

But in any event it appears that you have too many open file handles - but I guess you know that.

From Audio::Wav

use Audio::Wav; my $wav = new Audio::Wav; my $read = $wav -> read( 'input.wav' );
If you somehow keep track of this $wav object via a reference to it an array of hash or array of array or whatever, I would assume that the file handle to 'input.wav' remains open.

$wav=undef; would cause that complete object to be destroyed and the file handle freed - right Now! - not when Perl exits.

Perl will destroy objects upon exit, but sometimes it is necessary to "take control" and do that for yourself. Maybe undef'ing the $read variable is all you need?

It would be very helpful if you could provide some actual code.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://946716]
[choroba]: Good morning! I'll be mostly absent today, a day off at work, children have concerts and other activities...
[Corion]: Hi choroba! Yay, day off sounds great! I hope the performances of the kids go well!

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2017-12-12 08:45 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (327 votes). Check out past polls.