perl_mystery has asked for the wisdom of the Perl Monks concerning the following question:
Hi,I am using a perforce command "p4 where" as part of my script.I see the output getting stored in the variable "p4where_output" when the command is successful in the below code but when the command fails I see the following getting printed on the screen,can someone advise how to stop printing and capture the output even when the command fails?
OUTPUT on screen when the command fails:- //files/data.c - file(s) not in client view.
my $p4where_output=`p4 where $file`; if($p4where_output =~ /file(s) not in client view/) { push @changed_paths,"$file\n"; }
|
|---|