Is perl6 whitespace sensitive?
Or is this a bug?
I have a multi() for 1 and 2 artuments
But a 2 arg call ends up getting into the wrong sub
Apparently because there is a space between the sub name and the
Opening parenthesis?
multi mysub($arg1) {
say "mysub(one): $arg1";
}
multi mysub($arg1, $arg2) {
say "mysub(two): '$arg1' then '$arg2'";
}
mysub(555);
mysub(123, 456);
mysub(999);
mysub (123, 456); # a space between sub and parenthesis
output:
mysub(one): 555
mysub(two): '123' then '456'
mysub(one): 999
mysub(one): 123 456 <== whoops!
--
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm