By Michael Schwern (Schwern) from PDX.pm
Date: Sunday, October 12, 2008 03:40 PM
Duration: 20 minutes
Target audience: Any
Language:
Tags: method perl5 signatures
You can find more information on the speaker's site:
- Abstract: http://search.cpan.org/dist/Method-Signatures/
- Talk: http://www.slideshare.net/schwern/methodsignatures-presentation/
Method::Signatures finally provides method signature syntax in Perl 5, at full speed, without a source filter.
Instead of this:
sub echo {
my $self = shift;
my $arg = shift;
return $arg;
}
you can write this:
method echo($arg) {
return $arg;
}
It's about time!
But that's not all! It pulls in many features of Perl 6 so you can have required arguments, optional arguments, defaults, named arguments, aliases... It makes Perl 5 almost look like a real language!