Subject: | Default arguments underdocumented/broken(?) |
#!perl
use MooseX::Method::Signatures;
method foo($v = sqrt 2) {
}
__END__
Error parsing parameter near 'sqrt' in '$v = sqrt 2' at
/home/mauke/usr/lib/perl5/site_perl/5.16.1/MooseX/Method/Signatures/Meta/Method.pm
line 199.
I don't understand what's wrong with this code. The default argument
seems perfectly sensible to me. Unfortunately the only documentation I
could find for this feature is "method foo ($a = 42) # defaults to 42".
It would be good if the documentation explained how exactly default
arguments work.