$tf="C:\\Program Files (x86)\\Microsoft Visual Studio 10.0\\Common7\\IDE\\tf.exe"; $buildLabel = "the build label"; $/ = undef; BuildCheckedInToTFS(); sub BuildCheckedInToTFS(){ my $checkedIn = 0; print "Verifying build label exists in TFS...\n"; `\"$tf\" labels /owner:theOwner \"$buildLabel\" > "TFSLabelInfo.txt"`; open TFSLABEL, "TFSLabelInfo.txt" or die $!; my $TFSLabel = ; close TFSLABEL; if ($TFSLabel =~ /$buildLabel/){ $checkedIn = 1; print "Build $buildLabel has been checked-in to TFS."; } else { print "Baselining failed. \n:" + "Build $buildLabel has not been checked-in to TFS."; } return $checkedIn; }