Path: utzoo!news-server.csri.toronto.edu!rutgers!dimacs.rutgers.edu!seismo!ukma!rex!samsung!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!deccrl!news.crl.dec.com!shlump.nac.dec.com!fyrpwr!prakash From: prakash@fyrpwr.enet.dec.com (Mayank Prakash) Newsgroups: comp.lang.perl Subject: Fall-through exit does not close files. Message-ID: <21156@shlump.nac.dec.com> Date: 15 Mar 91 23:41:54 GMT Sender: newsdaemon@shlump.nac.dec.com Reply-To: prakash@aiag.enet.dec.com Distribution: usa Organization: Digital Equipment Corporation, Marlboro, MA. Lines: 27 -- I had a perl script in which I opened a file thus open(FOO, "| filter"); and then did a bunch of writes to FOO. My script exited by just falling through the end, and the output never got to the filter. Finally, I put a close(FOO); at the end of the script, and it worked. Should all filehandles be closed before exiting? -mayank. +--------------------------------------------------------------------------+ | InterNet: Prakash@AIAG.ENET.DEC.COM | | UUCP: ...!decwrl!aiag.enet.dec.com!Prakash | | VoiceNet: (508)490.8139 | | BitNet: prakash%aiag.enet at decwrl.dec.com | | SnailNet: DEC, 290 Donald Lynch Blvd. DLB5-2/B4, Marlboro, MA 01752-0749 | +--------------------------------------------------------------------------+ Disclaimer: The above is probably only line noise, and does not reflect the opinions of anybody, including mine, far less my employer's.