creating a log file

K

king

Hi I am running so many commands in a single perl script.
Now i want to create a log file which will save the output of the
commands.
I am using win32::process for running commands in perl.
so how i will save the outputs of commands in a log file.
because redirest is not working in win32::process.
My idea is what ever i am running inside script, i want a log file for
that.
 
B

Ben Morrow

Quoth "king said:
Hi I am running so many commands in a single perl script.
Now i want to create a log file which will save the output of the
commands.
I am using win32::process for running commands in perl.

I doubt that; there is no such module AFAIK. Do you mean Win32::process?
so how i will save the outputs of commands in a log file.
because redirest is not working in win32::process.

You *ought* to be able to redirect STD{IN,OUT,ERR} to wherever using
Win32::process; but I have found it unreliable in the past. Provided
you are using a new enough version of Windows (NT >2000), cmd.exe has
Bourne-ish redirection operators, so you're (IME) better off using
system instead. Don't try and use the list version, though: it isn't
any safer on Win32, 'cos Win32's argv passing is broken, and you can't
do redirects.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top