in reply to RE: Wanted feature in perl 6
in thread Wanted feature in perl 6

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.

Replies are listed 'Best First'.
RE: Wanted feature in perl 6
by agoth (Chaplain) on Aug 07, 2000 at 13:17 UTC
    Oh, quite neat idea really, cheers