$cmd = [ (qw(p4 diff -f -sl), $options{v}) ]; run3($cmd, \$stdin, \$stdout, \$stderr); #print "\n$stderr\n"; #Output the diff to p4diff.log open(my $P4DIFF, '+>', "p4diff.log") or die $!; print $P4DIFF $stdout; $input = ; #Open teh p4diff.log to get the missing files and output to deletefiles.txt open(my $OUTPUT, '+>', "deletefiles.txt") or die $!; open my $DATA, '<', $input or die "could not open '$input' $!"; while ($line = <$DATA>) { print "IN WHILE LOOP\n";#not printing if ($line =~ /missing/) { $line =~s/\\/\//g; $line =~s/\Q$client_root\E/$perforce_root_dir/g; print "$line\n"; print $OUTPUT $line; } } close $OUTPUT;