in reply to Re^5: Moose type question
in thread Moose type question

we have been discussing the best way to solve this.

An empty list cannot be placed in a scalar, so you could use an empty list.

sub f { my $coercion_occurred = 1; # ... my $coerced_value = undef; # ... if ($coercion_occurred) { return $coerced_value; } else { return (); } } my $coercion_occurred = ($coerced_value) = f();