It allows a gretaer amout of flexibility in the calling of your sub.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 }
In reply to RE: RE: Wanted feature in perl 6
by tvakah
in thread Wanted feature in perl 6
by tvakah
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |