The capital club have not won at McDiarmid Park in the league since 2010 and never looked like improving on that dismal track record.
They have now failed to net in four of their last five games and share bottom spot with St Mirren.
The full-time whistle prompted a hostile reaction from visiting supporters as they vented their frustration towards Tynecastle manager Levein.
After a tentative opening period, Saints crafted the first opening in the 15th minute. Midfielder Murray Davidson watched a left-foot shot deflect for a corner off Berra after David Wotherspoon had sent over a cross from the left.
Minutes later St Johnstone striker Stevie May opted for a first-time snapshot but ballooned his effort over the target.
Hearts full-back Aidy White got forward to support the attack in the 19th minute but dragged an 18-yard shot well wide after finding space on the edge of the penalty area.
Berra was booked for a needless foul on May near the halfway line and when Hearts winger Callumn Morrison finally posed a threat to the home defence the winger's shot was aimed straight down the throat of keeper Zander Clark.
Saints began the second half on the front foot and White was cautioned for gripping Drey Wright.
The home side made the breakthrough in the 59th minute after pressure had been building, with Matty Kennedy and Wotherspoon spurning half chances before Pereira was forced to turn a Davidson shot round a post.
Wright's subsequent corner was missed by Saints captain Jason Kerr but his presence distracted Berra and the ball clipped him and rolled over the line.
It was the first time Saints had taken the lead in the league this season, prompting chants of "Craig Levein, we want you to go" from pockets of the visiting support.