marauder has asked for the wisdom of the Perl Monks concerning the following question:

I have this code
use Audio::Wav; my $wav = new Audio::Wav; my $read = $wav -> read( "$filename.wav" ); my $details = $read -> details(); my $frequency = $details -> {sample_rate};
it gets wav details as I wish but still keeps the file open so when I try to move the file later on in the script I get the error "file being used by another process". Can anyone tell me how to close the file?

Replies are listed 'Best First'.
Re: audio::wav::read
by premchai21 (Curate) on Jan 18, 2002 at 00:57 UTC

    Since the documentation for Audio::Wav doesn't seem to have anything on this, and since I can't get to the source from here, I would guess that destroying the object (undef $read) would close the file.

      Or perhaps undef $wav instead...