Skip Menu |

This queue is for tickets about the Fun CPAN distribution.

Report information
The Basics
Id: 80691
Status: new
Priority: 0/
Queue: Fun

People
Owner: Nobody in particular
Requestors: MAUKE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 0.05
Fixed in: (no value)



Subject: slurpy parameters accept default arguments
$ cat bug/slurpy-default #!perl use Fun; fun foo(@x = 42) {} __END__ n$ perl -MO=Deparse bug/slurpy-default use Fun; sub foo { do { do { my(@x) = @_ }; do { @x = 42 if @_ <= 0 } }; (); } ; __DATA__ bug/slurpy-default syntax OK OK, so (apart from the B::Deparse output being wrong about the scoping of @x :-) it seems like you can specify default arguments for slurpy parameters. Personally I think this should be a hard error because an empty list is perfectly fine to assign to an array and there's no way to distinguish between an empty list and an absent list, but at least the behavior should be documented.