Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > write to stdout and another file at the same time.

Reply
Thread Tools

write to stdout and another file at the same time.

 
 
akbari_n@yahoo.com
Guest
Posts: n/a
 
      06-04-2005
All,

I am writing a perl script that does do a bunch of admin stuff.
What I need help with is this (I have done it in the past, I just can
not remember it now !)

I need to capture everything that this script does.

For example if it prints something to the screen, I need that to be
dumped into a file at the same time. So we are writing in 2 places.
1) To the screen 2) A file that acts as our log file.

Please keep in mind that I need to do this from inside the perl script.
I do not intend to do it this way " myScript.pl > log& ". A long time
ago I did that and put one line after the magic line and it took care
of it for me, it had something to do with |tee.
I just can not remember it and I can not figure it out.


Any help is greatly appreciated.

Thanks in advance,

p-

 
Reply With Quote
 
 
 
 
John W. Krahn
Guest
Posts: n/a
 
      06-04-2005
http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
>
> I am writing a perl script that does do a bunch of admin stuff.
> What I need help with is this (I have done it in the past, I just can
> not remember it now !)
>
> I need to capture everything that this script does.
>
> For example if it prints something to the screen, I need that to be
> dumped into a file at the same time. So we are writing in 2 places.
> 1) To the screen 2) A file that acts as our log file.
>
> Please keep in mind that I need to do this from inside the perl script.
> I do not intend to do it this way " myScript.pl > log& ". A long time
> ago I did that and put one line after the magic line and it took care
> of it for me, it had something to do with |tee.
> I just can not remember it and I can not figure it out.
>
> Any help is greatly appreciated.


perldoc -q "How do I print to more than one file at once"



John
--
use Perl;
program
fulfillment
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems redirecting STDOUT (NOT sys.stdout) to a pipe. Elad Python 0 03-19-2006 01:30 PM
write to the same file from multiple processes at the same time? gabor Python 19 05-31-2005 01:57 PM
Re: write to the same file from multiple processes at the same time? Jp Calderone Python 4 05-31-2005 07:54 AM
Re: write to the same file from multiple processes at the same time? Jp Calderone Python 7 05-28-2005 06:47 PM
Re: write to the same file from multiple processes at the same time? Jp Calderone Python 0 05-27-2005 02:17 PM



Advertisments