Finally, method foo($arg)!

By Michael Schwern (‎Schwern‎) from PDX.pm
Date: Sunday, October 12, 2008 03:40 PM
Duration: 20 minutes
Target audience: 1
Language:
Tags: method perl5 signatures

You can find more information on the speaker's site:


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!

Attended by:

Copyright © 2006-2008 Pittsburgh Perl Mongers. Mast photo by whobee@flickr.