Caleb Cushing's Blog

Perl Core Syntax Wishlist: Role Support

I want to see Role’s added, even PHP got Traits before Perl. It doesn’t have to be a huge thing, in fact all I want is the composition aspect. Let me do this: package MyRole { sub foo { return 'test' } } package MyClass { with 'MyRole'; ... } MyClass->new->foo; I don’t really want or need anything else right now, just that would be fine. We should have interfaces too, but they aren’t really required just to support Role’s. Read more →

Perl Core Syntax Wishlist: Class support

I would like to see the class keyword become part of Perl, but unlike some I don’t want it simply because it’s nicer syntax. I’d like it to behave differently from package. I’d basically like to see this class MyClass { method foo { return $self->{foo} } method info { return load_class(‘Class::Info’)->new } } to be the equivalent of { use strict; use warnings; use utf8; # so our class can be named with utf8 Read more →

Perl Core Syntax Wishlist: die should die

I hate die it is, in my humble opinion, one of the worst parts of perl. I really wish it would be deprecated, and removed, or at least replaced with something that would tell you were the code that was die-ing was being called. Replace its implementation with that of Carp’s croak or confess and I’d be happy. Better yet, let’s just get real exception support and deprecate die (even if that’s never removed deprecation just make that real big on its pod). Read more →

Perl Core Syntax Wishlist: an Exception Stack

I have come to wish many things were part of Perl syntax that are not, and no using external modules is not enough for me. I think it’s time Perl got the features as part of the language itself (and yes I suppose I could settle for, and no I’m probably not going to write them myself, I’m not smart enough yet). The first of these is a proper exception stack. Read more →