[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Redirecting Output



At 10.27 -0500 1999.01.07, Richard Gordon wrote:
>So, the question is once you've redirected output to a new file, how do you
>switch it back to the original STDOUT target? My first guess is that you
>would capture the state of STDOUT to a variable to begin with and then use
>something like select($original_state), but I'm not at all clear on this.
>Thanks.

  my $oldfh = select(NEWFH);

  # ...

  select($oldfh);

select() returns the current filehandle.  Just save it and select it later.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey = ('B76E72AD', [1024, '0824090B CE73CA10  1FF77F13 8180B6B6'])

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch