defined is not a loop, it is a function. That may sound pedantic, but it's difficult to help people who use words wrong, because it's hard to understand them.
One of many ways to do what (I *think*) you want would be to make the last line
return defined($not_exposed_reason)?$self->{_not_exposed_reason}:"No e
+xposed reason";
which uses the ? : construct (sometimes called the ternary conditional operator) to produce the value before the : if the condition before the ? is true, and the one after the : if the condition is false. I'm not entirely sure how helpful that is, because your question is pretty hard to parse.