perl - Function::Parameters - what does "In method ...: missing type name after '['" -
i have problem using module function::parameters types::standard. in code, in person.pm:
package person; use strict; use warnings; use function::parameters; use types::standard qw(instanceof); method is_taller_than( instanceof['person'] $other ) { return; } 1; using perl -cw person.pm reports:
in method is_taller_than: missing type name after '[' @ person.pm line 9. how can fix this?
this looks parsing limitation in function::parameters. can handle barewords , square brackets, not quoted strings. way around put parentheses around type expression:
method is_taller_than( (instanceof['person']) $other ) {
Comments
Post a Comment