in reply to Wanted feature in perl 6

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 = @_; }

Replies are listed 'Best First'.
RE: RE: Wanted feature in perl 6
by tvakah (Novice) on Aug 04, 2000 at 21:27 UTC
    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