Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: Recap: The Future of Perl 5by RonW (Parson) |
on Aug 23, 2018 at 23:05 UTC ( [id://1220966]=note: print w/replies, xml ) | Need Help?? |
Note that Perl does ship with a (still) core module called Class::Struct, which offers a simple syntax for OO programming. An example I wrote 2 years ago is somewhat similar to the Point class example you provided. I only wrote it as a rebuttal to a claim that Perl OO programming is very hard without installing something from CPAN
Not as clean as your proposed syntax, but is something that can be used without needing anything from CPAN. And there are limitations, such as Class::Struct classes can only inherit from UNIVERSAL. Edit: corrected syntax as pointed out by LanX. Also, changed mod:// links to doc://
In Section
Meditations
|
|