Matt Diephouse writes: > use CGI qw(:standard); > > my $foo = Bar->new( > name => "Baz", > value => param('baz'), > something => 'else' > ); > > See the problem?
Yikes, yeah, that seems so innocent. > C<param> uses C<return;>. In this example, it's called in list > context. So if there is no 'baz' parameter, the list will get shifted > like so: > > my $foo = Bar->new( > name => "Baz", > value => "something", > else => undef > ); > > I can't imagine how much trouble this would have caused me if I didn't > know about the C<return;> special case. Any chance this will work > differently in Perl 6? Yep. First of all, param('baz') would be called in scalar context, since it's on the right side of a pair constructor, as you're about to say. > I'd be tempted to suggest that C<<=>>>, in its new role as pair > constructor, put things in scalar context, but lately I've started to > write join's like so: > > my $string = join "," => @array; No such luck. I use => in all sorts of places where , usually goes. But I'm going to have to change my ways for Perl 6. All in all, I think the pair object gives us too many wins over the fat comma. On the other hand, you can now write your join in any of the following ways: join ",", @array; @array.join(","); join @array: ","; &*join(q{,}<[EMAIL PROTECTED]); :-) Luke