When you raid the cave next to the Eye Gate in the Valley of the Fallen, you'll find a key that will let you into a cave located where the river ends.
Work your way through there, and while in a certain room Rynn will exclaim, "Looks like someone's up there".
That would be Perry.
Kill the large Wartok guard, retrieve a key from a table and pull a lever to release Perry.
You can figure the rest!