This is not completely indirect object syntax:
print $log "It works!\n" if $object->is_valid();You would instead write:
print $log "It works!\n" if is_valid $object;Your second snippet would likewise be:
$log->print( "It works!\n" ) if $obj->is_valid();I fail to see how that is less appealing.
In reply to Re: Re: OO style: Placement of "new"
by chromatic
in thread OO style: Placement of "new"
by crenz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |