in reply to Re^7: Assignable Subroutines
in thread Assignable Subroutines
It's a fine notion but it has it's problems.
You now, need to code
print $obj->thing;
$obj->thing = 'someting';
$obj->thing =~ s[this][that]g;
my @subthings = $obj->thing =~ m[subthing]g;
my $count = $obj->thing =~ m[subthing]g;
while( $obj->thing =~ m[subthing]g ) { last if substr( $obj->thing, pos( $obj->thing ) - 22, 22 ) eq 'This is *the* subthing'; }
(Oh! And a substr_thing() method;)
$obj->thing++;
++$obj->thing;
And all the others that you effectively get for free with a single lvalue method.
All that is missing is a convenient way to validate the assignment.
|
|---|