perl_mystery has asked for the wisdom of the Perl Monks concerning the following question:
Hi, If I run the "p4 where" command on a variable like "p4 where $file",I dont see any output where as if I change the command to run on a file like "p4 where //depot/perl/files/scripts/file.c",the command works.I am not sure if its due to run3 issue or something to with qw operator?Can someone advise where am I going wrong?
use strict; use warnings; use IPC::Run3; use Data::Dumper; my @branched_paths; my $savefile='//depot/perl/files/scripts/file.c'; my $cmd = [ qw(p4 where $savefile) ]; #my $cmd = [ qw(p4 where //depot/perl/files/scripts/file.c) ]; #works #print "CMD:$cmd\n"; my ($stdin, $stdout, $stderr); run3($cmd, \$stdin, \$stdout, \$stderr); print $stderr; chomp($stderr); if ($stderr =~ /file\(s\) not in client view/) { #print "in"; push @branched_paths,"$savefile"; } print @branched_paths;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IPC::Run3 or qw operator issue?
by toolic (Bishop) on Jan 05, 2011 at 01:03 UTC | |
|
Re: IPC::Run3 or qw operator issue?
by ikegami (Patriarch) on Jan 05, 2011 at 01:19 UTC |