Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have the following line of code:
open (INPUT, "net use |") || die $!;
I'm working on a windows platform, does anyone know how I can redirect that default output from the screen to a secified file?, or even better grab a list of active network drives and write to a file Thanks

Replies are listed 'Best First'.
Re: STDOUT to a file
by coreolyn (Parson) on May 31, 2002 at 19:52 UTC

    tsk tsk Super Search is your friend

    I believe your looking for this

    If you want to live dangerous you could use open3 but read the warning. I've been using it heavily and have had only a few problems (mysterious hangs) that I can't even say for sure are from my use of open3 - ( read the entire thread and comments as most of the code there is irrelevant).

    coreolyn