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

Re: [MacPerl] Any way to Tee in MacPerl?



At 08.24 1998.02.13, Wade Williams wrote:
>I'm writing a program that's eventually going to end up on UNIX and I need
>to write to two files (STDOUT and a file) simultaneously.
>
>I know that on UNIX, I can do:
>
>open(FILE, "| tee file2");
>
>print FILE "some text\n";
>
>and get my desired result.  However, unless someone's written a Mac version
>of tee, I don't think that's gonna work on the Mac (which is where I'm
>doing my development).
>
>Anyone ever developed a solution for this?

Well, I don't know of a better solution, I have done this:

my_print_open();
my_print("hey\n", "hey\n", "we're the monkeys\n");

sub my_print {
  print FILE1 @_;
  print FILE2 @_;
}

sub my_print_open {
  # open some files here ...
}

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==               New Book:  MacPerl: Power and Ease               ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



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