That being said, it would also be useful to characterize features that are completely unique to a given language.Perl has all these features.
1) a unique and powerful version of super() for working with multiple inheritance
Perl (with Moose) has before, after, around, override, and augment in addition to super. And, it has "Roles" so you don't have to resort to hacks like multiple inheritance to implement mixins or interfaces.
2) it has generators (the yield statement) that allows state to be suspended and restarted (and allows data and/or exceptions to be passed back in to the generator)
Perl has the library Coro, which allows multiple Perl and C stacks. With this coroutine and call-with-current-continuation are implemented.
3) the with-statement for managing contexts and for providing a new way to factor code
Perl has scope a few implementations of scope guards; Guard and Scope::Guard. It's not quite the same as with, because with's semantics around:
with open_file('foo') as f:
return f
are unclear (f is closed but the object still exists). Perl mixes
sub x {
my $f = file('foo')->openr;
return $f; # $f is still open and ready for reading by the caller
}
Emulating Python is still possible, however:
sub x {
my $f = file('foo')->openr;
scope_guard { $f->close }
return $f; # caller gets a closed file object
}
4) easy-to-write class and function decoratorsThis you don't really get, though you do get all of the things I've seen them used for in Python. You can even hack Perl syntax in a lexical scope, but that's evil so I will pretend it's impossible :)
5) metaclass support that provides full control over the creation of classes; 6) and descriptors for fine-control over attribute/method binding behavior
Moose. And unlike Python, there are libraries that take advantage of this to provide tiny bits of OO functionality that you can pick and choose from. Look on CPAN for a MooseX:: module, and chances are that the set of libraries you choose to use to augment a class will all work together.
The difference between Perl and Python is that Perl's features are implemented as modules, while Python's features are implemented in the core. That means that if you come up with a good idea, you can start using (and sharing) it immediately, while with Python, you have to wait until the next major release.