I think that perl 6 should provide the variable %_ when inside a sub. As if one had said:
sub foo { %_ = @_; ... }
It would save at least one line of code.

Replies are listed 'Best First'.
RE: Wanted feature in perl 6
by chip (Curate) on Aug 03, 2000 at 23:57 UTC
    I don't think Perl 6 feature requests are on topic here.

        -- Chip Salzenberg, Free-Floating Agent of Chaos

RE: Wanted feature in perl 6
by merlyn (Sage) on Aug 07, 2000 at 16:41 UTC
    I wouldn't want Perl to go to the expense of building the hash when it didn't need it. I rarely use named parameters. And it's only one line of code, and a very short line at that.

    -- Randal L. Schwartz, Perl hacker

RE: Wanted feature in perl 6
by agoth (Chaplain) on Aug 04, 2000 at 16:01 UTC
    What advantage would that achieve? that isnt catered for by either references or just lists

    myfoo(\%hash1); myfoo2(%hash2); sub myfoo { my $ref = shift; my %hash = %{ $ref }; #longwinded i know } sub myfoo2 { my %flibble = @_; }
      The reasion I had in mind is as follows:
      process( text => 'this is some text' ); process( file => 'foo' ); sub process { my $text; if( defined $_{'text'} ) { $text = $_{'text'}; } elsif( defined $_{'file'} ) { local $/; open IN, $_{'file'}; $text = <IN>; close IN; } else { die "Usage"; } #proccess $text and return result }
      It allows a gretaer amout of flexibility in the calling of your sub.
        Oh, quite neat idea really, cheers