I'm at a loss to see how this is preferable to:
Juerd has a node that demonstrated this nicely, but I cannnot find it right now. Compare:
$obj->bar++; $obj->bar =~ s[a][b]g; $obj->len++ while substr( $obj->bar, $obj->start, $obj->len ) =~ m[^\s ++$]; substr( $obj->bar, $obj->start, $obj->len, ''); $obj->len = 0;
with:
$obj->bar( $obj->$bar() + 1 ); my $temp = $obj->bar(); $temp =~ s[a][b]g; $obj->bar( $temp ); my $temp2 = $obj->len; my $temp3 = $obj->bar; $temp2++ while substr( $temp3, $obj->start(), $temp2 ) =~ m[^\s+$]; substr $temp3, $obj->start, $temp2, '' ); $obj->bar( $temp2 ); $obj->len( $temp3 );
Another way of looking at it. Would you prefer doing math like this?
## $a++; $a( $a() + 1 ); # $b *= $c-- $d++; $b( $b() * $c( $c() - 1 ) % $d( $d() + 1 ) );
In reply to Re^4: Are lvalue methods (as properties) a good idea?
by BrowserUk
in thread Are lvalue methods (as properties) a good idea?
by jplindstrom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |