Ivan Heffner wrote:
> Use Perl's short-circuiting logical '||'
> to make a single method call (or set of method calls):
>
> foreach my $family ( $cartoon->families() ) {
> if ( ( $cartoon->$family->husband() || '' ) eq 'fred') {
> print "yes\n";
> }
> }
Or even:
( $cartoon->$family->husband() // '' ) eq 'fred'