in reply to A question on defined loop

It would make more sense if you were checking the object's error excerpt (i.e. $self->{_error_excerpt}) and not some value you pass to the method. I will have to assume (since you don't show it) that you are calling error_excerpt without any arguments, so it is always undef, and hence you always get "No Error Excerpt".

Something like the following would make more sense:

sub error_excerpt { my $self = shift; return defined($self->{_error_excerpt}) ? $self->{_error_excerpt} : +"No Error Excerpt."; }