Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!brutus.cs.uiuc.edu!psuvax1!shire!schwartz From: schwartz@shire.cs.psu.edu (Scott E. Schwartz) Newsgroups: comp.lang.perl Subject: Re: Data-selected output channels Message-ID: Date: 3 Mar 90 06:19:41 GMT References: <547@arccs1.fed.FRB.GOV> <7252@jpl-devvax.JPL.NASA.GOV> Sender: news@cs.psu.edu (Usenet) Distribution: na Organization: Penn State University Computer Science Lines: 27 Larry writes: >Close, but you have to use indirection on the print statement too. I hate to keep asking for new features, but... well, no I don't... :-) I just keep wanting to deal with filehandles more like variables, rather than magic names, even if indirectly. Something more like C's FILE*'s: ^file1 = ^STDIN; "do something with ^file1" ^file1 = ^STDERR; "do something else" sub foo { local($i, ^file1) = @_; print ^file1, "blah $i"; &foo($i-1, ^file1) unless $i == 0; } &foo(10, ^STDIN); (I'm using the prefix "^" to indicate the "variable filehandle" namespace.) Well, you get the idea... -- Scott Schwartz schwartz@cs.psu.edu "the same idea is applied today in the use of slide rules." -- Don Knuth