Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!ucsd!ucbvax!iwarp.intel.com!news From: merlyn@iwarp.intel.com (Randal Schwartz) Newsgroups: comp.lang.perl Subject: Re: Passing file handles as parameters Message-ID: <1990May2.164445.11633@iwarp.intel.com> Date: 2 May 90 16:44:45 GMT References: <3751@taux01.UUCP> Sender: news@iwarp.intel.com Reply-To: merlyn@iwarp.intel.com (Randal Schwartz) Organization: Stonehenge; netaccess via Intel, Beaverton, Oregon, USA Lines: 28 In-Reply-To: crehta@tasu74.UUCP (Ran Ever-Hadani) In article <3751@taux01.UUCP>, crehta@tasu74 (Ran Ever-Hadani) writes: | I have a single routine which does the formatting of output | to all of them. I would love to be able to call the routine | with the output file as a parameter. Would this be possible | in the future? It has been possible for a long time. sub say_hello { local($filehandle) = @_; print $filehandle "hello world\n"; } &say_hello("STDOUT"); &say_hello("STDERR"); open(SMURF,">/dev/tty"); &say_hello("SMURF"); close(SMURF); Pretty durn easy if you ask me. And it's even documented! $_ = "Jvtu bopuifs Pfsm ibdlfs,"; y/a-z/za-y/; print -- /=Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095 ==========\ | on contract to Intel's iWarp project, Beaverton, Oregon, USA, Sol III | | merlyn@iwarp.intel.com ...!any-MX-mailer-like-uunet!iwarp.intel.com!merlyn | \=Cute Quote: "Welcome to Portland, Oregon, home of the California Raisins!"=/