It will run faster, because it doesn't have to evaluate
the want(). (97,98) doesn't invalidate the current way of doing
things, it just gives a new way. And in syntax that is currently
erroneous.
Nathan Wiger wrote:
>
> > And what will aSub decide is it's context?
> >
> > @foo = (1, 2, 3, aSub)
> >
> > If I have to write scalar(aSub) then I see no point in this RFC.
What is it now? is
$ perl -le 'sub A() {wantarray?"array":"scalar"}; @foo = (1,2,3,A); print @foo'
123array
That would be array context.
> > And why shouldn't the caller decide? What is the gain in having perl
> > do the dirty work.
>
> I agree. I don't see any reason to have to define 2 subs:
>
> @ sub mysub {
> # whole bunch of stuff happens
> return @array;
> }
>
> $ sub mysub {
> # same stuff that happens above happens here too
> return $scalar;
> }
>
> Instead of just one:
>
> sub mysub {
> # whole bunch of stuff happens
> if ( want 'ARRAY' ) {
> return @array;
> } else {
> return $scalar;
> }
> }
>
> This doesn't make any sense to me, I don't see any win here. Not being
> mean, just being honest.
>
> -Nate
--
David Nicol 816.235.1187 [EMAIL PROTECTED]
:wq