in reply to How about class Foo {...} definition for Perl?

I know you'll hate what I am about to say, but I find Perl 5's OO syntax rather ugly. Looks better with your module, but you still have to write classes full of $this->{X} and my $this = shift; that are a nuisance - mostly if compared to the rest of the language and its overall elegance. With your module, the syntax is rather similar to PHP's objects, and it's frankly better than Perl's (no pun intended - really).

Am I the only one feeling that Perl syntax about objects is awful? I believe a language should primarily be a tool to think in, and then a way to tell a computer to do things. I'd better not think in Perl 5 objects....

Replies are listed 'Best First'.
Re: Private rant
by gmpassos (Priest) on Jan 19, 2004 at 16:14 UTC
    "...Looks better with your module, but you still have to write classes full of $this->{X} and my $this = shift; that are a nuisance..."

    You don't need to declare my $this = shift, Class::HPLOO will handle it automatically for you. About $this->{x}, yes, you still need to use it and any filter that tries to handles scope variables and global variables as an object attribute wont work very well!

    But note that OO is much more than just a syntax, and Perl is one language that let us to know exactly how OO is build, what let us to build it like we want.

    Graciliano M. P.
    "Creativity is the expression of the liberty".