The 34-year-old defender spent 16 years at McDiarmid Park and famously scored in the Scottish Cup final win over Dundee United in 2014.
Anderson has had loan spells with Partick Thistle and Raith Rovers in recent seasons and has now put pen to paper with Stuart Malcolm's side.