The Giants’ Matt Cain comes one batter shy of a perfect game in beating the Pirates, 5 – 0, in the team’s home opener. He settles for a one-hitter, with mound rival James McDonald’s 6th-inning single representing the only baserunner.

On April 13, 2012 – – The Giants’ Matt Cain comes one batter shy of a perfect game in beating the Pirates, 5 – 0, in the team’s home opener. He settles for a one-hitter, with mound rival James McDonald’s 6th-inning single representing the only baserunner.

Source:
Baseball Reference April 13