#!/usr/bin/perl
# File: useMyTeeFile

use MyTeeFile; 

open (teeFH, ">tee.out") or die;

tie *FH,'MyTeeFile',\*teeFH,\*STDOUT;

print "Enter a line ('q' to quit): ";
while (($inline = <STDIN>) !~ /^q|Q/)
{
  print  FH $inline;
  print "Enter a line ('q' to quit): ";
}

close (teeFH);


