 He served as a member of the Maryland House of Delegates from 1834 to 1836 and was elected as a Democrat to the Twenty-ninth United States Congress, serving from March 4, 1845, to March 3, 1847.He was not a candidate for renomination in 1846.After Congress, Perry served as associate judge of the sixth judicial district of Maryland from 1851 to 1861 and again from 1864 to 1871.