Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like to be able to re-direct the STDOUT of a system call to a specific file. I'm using the following code:
I'm having no luck...any suggestions?#!Perl/bin/perl.exe -w use strict; use File::Spec::Win32; use FileHandle; # print "Enter the model handle\n"; # print " mh=: "; chomp (my $mh = <STDIN>); my $fh=FileHandle->new(">Model_Information.txt"); &phork; sub phork { open(STDOUT, '> ' . File::Spec->$fh); open(STDERR, '> ' . File::Spec->devnull); } system "SomeSystemCall.exe";
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: system and STDOUT
by robartes (Priest) on Nov 15, 2002 at 23:31 UTC |