in reply to Re: FileHandle->close() is not closing everything
in thread FileHandle->close() is not closing everything

Here's the actual code for the OPEN:
} elsif (SliMP3::Info::isOgg($fullpath) && SliMP3::Prefs::get("transc +ode-ogg")) { # Note we have to put the path in double quotes so that # spaces in file names are handled properly. my $ogg_cmd = "ogg123 -q -p 5 -d raw -f - \"$filepath\""; my $lame_cmd = "lame -x -r - - &"; $client->mp3filehandle( FileHandle->new() ); $client->mp3filehandle->open("$ogg_cmd | $lame_cmd |");
Here's the actual code for the CLOSE:
# close the previous handle to prevent leakage. if (defined $client->mp3filehandle()) { $client->mp3filehandle->close(); $client->mp3filehandle(undef); $client->mp3filehandleIsSocket(0); }
The OPEN is called when PLAY, NEXT, PREVIOUS is called. OPEN, always calls CLOSE to make sure that there are no running processes. So the code really does work that way. But I see your point about TERM.

Replies are listed 'Best First'.
Re: FileHandle->close() is not closing everything
by Abigail-II (Bishop) on Mar 28, 2003 at 15:37 UTC
    Well, it's doing just as I said, a pipe-open. A close() closes the pipe. Whether the program on the other ends terminate is up to said program, Perl will not take any attempts to kill the program off.

    Abigail