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();
In reply to Re^6: Moose type question
by ikegami
in thread Moose type question
by Sue D. Nymme
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |