#!/usr/local/bin/perl # Test script to write to STDOUT # and STDERR. use warnings; use strict; print STDOUT "StdOut!\n"; print STDERR "StdErr!\n"; #### #!/usr/local/bin/perl # Script to test IPC::Open3 # Runs, displays $pid to STDOUT, but opened # files are empty. use strict; use warnings; use diagnostics; use IPC::Open3; $|++; my $cmd = "/home/baz/test.pl"; open(ERRLOG, ">error.log") or die "Can't open error log! $!"; open(OUTPUT, ">output.log") or die "Can't open output log! $!"; my $pid = open3(\*STDIN, \*OUTPUT, \*ERRLOG, $cmd) or die "$!"; print "PID was $pid\n"; close(ERRLOG) or die "Can't close filehandle! $!"; close(OUTPUT) or die "Can't close filehandle! $!";