"It feels great," Hernandez said. "Didn't try to overthrow, kept the ball down, making ground balls. That's what I want to do, keep the ball down."
Yankees second baseman Scott Sizemore broke up the perfect game with a single to start the top of the sixth inning, and Hernandez was then relieved by Jeremy Horst.
"I was very, very confident with every pitch," Hernandez said. "I threw a lot of two-seamers. Mostly two-seamers. Changeup. Threw a couple sliders, too."
The Phillies have been struggling this spring, but they strung together a few hits against the Yankees. After leaving runners in scoring position in the first and second innings, five singles and one double led to three runs in the third inning against Yankees right-hander Ivan Nova to give the Phillies a three-run lead.
Ben Revere, Chase Utley, Marlon Byrd, Ryan Howard and Domonic Brown each singled in the third inning. Darin Ruf doubled down the left-field line, but Brown was thrown out at the plate trying to score.
Jacoby Ellsbury hit a solo homer as part of a two-run seventh for the Yankees. Francisco Cervelli's fifth RBI of the spring plated New York's other run in the inning.
The Phillies added three runs in the eighth, when Reid Brignac doubled home Kevin Frandsen before Tommy Joseph doubled home Clete Thomas and Brignac.
Up next: Jimmy Rollins is scheduled to make Friday's trip to play the Pirates at 1:05 p.m. ET in a Grapefruit League game in Bradenton. The game can be heard via an exclusive webcast at phillies.com. Rollins has not played since Monday, and manager Ryne Sandberg said he was just giving the veteran a breather and that Rollins has "his playing time and at-bats coming up." Right-hander Jeff Manship is scheduled to start for the Phillies.
Todd Zolecki is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.