Matt Cain became the first pitcher in the Giants' long history to pitch a perfect game, retiring all 27 Houston Astros he faced.