foreach my $file (@changed_files) { #my $p4where_output=`p4 where $file > NUL: 2>&1`;#backticks option not working,so commented out #print "P4 where output:$p4where_output\n"; my $cmd = "p4 where $file"; local(*HIS_IN, *HIS_OUT, *HIS_ERR); my $childpid = open3(*HIS_IN, *HIS_OUT, *HIS_ERR, p4 where $cmd); print HIS_IN "stuff\n"; close(HIS_IN); # Give end of file to kid. my @outlines = ; # Read till EOF. my @errlines = ; # XXX: block potential if massive print "STDOUT:\n", @outlines, "\n"; print "STDERR:\n", @errlines, "\n"; print @errlines; close HIS_OUT; close HIS_ERR; waitpid($childpid, 0); if ($?) { print "That child exited with wait status of $?\n"; } if(@errlines eq 'file(s) not in client view') { push @changed_paths,"$file\n"; } }