in reply to $c->flash Not Dereferencing Data Objects

I don’t have time to write test code but I think see the problem. You can only use a flash entry once. It’s gone—removed from the session—after that. The entire point is it cannot persist past a single use. Put it in the stash instead—unless you need it to persist past a redirect or something—and you should be fine. And just to be clear, this is actually a Catalyst question, not a DBIx::Class question. The flash/stash is part of the Catalyst context and its session.

More detail, when you do if $c->flash->{bio}, you just used it so it’s gone by the time you get to the assignment. Also note, you should never put a conditional on an (update: variable declarative) assignment statement. It can behave strangely.

# Unpredictable- my $x = 1 if $y; # Safe- my $x; $x = 1 if $y;

Update in case you do need it as flash, untested–

<%init> my $bio = $c->flash->{'bio'}; </%init> % if ( $bio ) { <p>My name is <% $bio->name |h %><br /> My residence is at <% $bio->address |h %></p> % }

Update, added HTML escape filters. Been ages since I did Mason. :P NEVER trust user input.