Re: sending output to file and terminal



Hi,

I think you do not have that perl module installed.

You can install it from the following link

http://search.cpan.org/~dagolden/Tee-0.13/lib/Tee.pod <http://search.cpan.org/%7Edagolden/Tee-0.13/lib/Tee.pod>

You can download the Tee-0.13.tar.gz <http://search.cpan.org/CPAN/authors/id/D/DA/DAGOLDEN/Tee-0.13.tar.gz>

After un-tarring follow the instructions given in the INSTALL file

#!/usr/local/bin/perl


use Tee;

@files = ("/home/bseenu/a.txt");
tee( ps, @files );

bseenu@bseenu-dt:~$ perl tee.pl
PID TTY TIME CMD
13558 pts/0 00:00:00 bash
15437 pts/0 00:00:00 perl
15442 pts/0 00:00:00 sh
15443 pts/0 00:00:00 ps
15444 pts/0 00:00:00 perl

bseenu@bseenu-dt:~$ cat a.txt
PID TTY TIME CMD
13558 pts/0 00:00:00 bash
15437 pts/0 00:00:00 perl
15442 pts/0 00:00:00 sh
15443 pts/0 00:00:00 ps
15444 pts/0 00:00:00 perl


-srini



lakshmi priya wrote:
Hi,

Thanks for your prompt reply, I have no idea how to use perl modules. Could you please help.

I tried using
use IO::Tee;
use IO::Handle;

but i got an error saying
Can't locate IO/Tee.pm in @INC (....)

please help....


On 3/29/07, *Boga Srinivas* <bseenu@xxxxxxxxxxxxx <mailto:bseenu@xxxxxxxxxxxxx>> wrote:

Hi lakshmi,

I think we can use the "Tee" module for that.

http://search.cpan.org/~dagolden/Tee-0.13/lib/Tee.pod
<http://search.cpan.org/%7Edagolden/Tee-0.13/lib/Tee.pod>

-srini

lakshmi priya wrote:
> Hi all,
>
> I have written a perl script that prints the output to the
> terminal. I
> also want to write the output to a file. So, what I have done is
> write the
> output to a file and then print the file. I was just wondering if
> there any
> way to write to both - terminal and file at the same time?
>
> With regards,
> laddu
>



.



Relevant Pages

  • Re: List all modules installed
    ... Also I tried perldoc -q install ... It gave me the steps on how to install a perl module. ...
    (perl.beginners)
  • Re: [SLE] dvdrip problems
    ... You need to install the Locale::TextDomain package (it's a Perl ... can find every Perl module you could possible want at ...
    (SuSE)
  • Re: Digest::MD4
    ... > have attempted to install is MD4. ... > default PERL path was by issuing the following command: ... but the normal way to install a Perl module is: ...
    (perl.beginners)
  • Config.pm - Installing modules in perl
    ... I'm trying to install a perl module XML-RegExp-0.03 (downloaded from ... The first step is to create a make file by running "perl Makefile.pl" ...
    (perl.beginners)
  • Re: attempt to build 64 bit on Solaris fails
    ... > libraries needed to link with a 64-bit Tk. ... We were running a 32-bit version of Perl ... > Each section below is a summary of the commands used to install it. ...
    (comp.lang.perl.tk)