Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!munnari.oz.au!frankland-river!pem From: pem@frankland-river.aaii.oz.au (Paul E. Maisano) Newsgroups: comp.lang.perl Subject: Operations on filehandles Message-ID: <1004@frankland-river.aaii.oz.au> Date: 5 Feb 90 00:41:08 GMT Organization: Australian AI Institute Lines: 27 I was wondering what sort of object a filehandle was and what can be done with one besides printing to them etc. Specifically, can you save them in a local context in some way, similar to what the local() function does with variables. For example, if I open a file in a subroutine and use a file handle called FILE which I open and then close, how do I know I'm not stomping on another filehandle called FILE which has already been opened somewhere else in my program. I could create a package to avoid the possibility of a naming conflict but this does not really solve the problem. What if I want to write a recursive subroutine which opens a file ? How do I keep separate filehandles for each recursive call ? Is there a simple way to do this or must I generate a unique filehandle name on each invocation ? Any ideas appreciated. ------------------ Paul E. Maisano (email: pem@aaii.oz.au) Australian Artificial Intelligence Institute 1 Grattan St. Carlton, Vic. 3053, Australia Ph: +613 663-7922 Fax: +613 663-7937