develooper Front page | perl.perl5.porters | Postings from March 2011

Re: Revising Perl's OO docs - a new OO tutorial

Thread Previous | Thread Next
From:
Johan Vromans
Date:
March 6, 2011 23:35
Subject:
Re: Revising Perl's OO docs - a new OO tutorial
Message ID:
m2tyfftmb6.fsf@phoenix.squirrel.nl
Father Chrysostomos <sprout@cpan.org> writes:

> If we do add object attributes to Perl, it would be very nice if we
> could use ‘$obj->attr = $foo’ syntax, instead of $obj->attr($foo),
> which is currently widely used mainly because the former is so hard to
> do (that can change, of course).

This would elegantly solve the semi-religious problem of using

    $obj->attr("foo") and $obj->attr
vs
    $obj->set_attr("foo") and $obj->get_attr
vs
    $obj->SetAttr("foo") and $obj->GetAttr

I think this is where :lvalue was invented for.

-- Johan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About