> 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.
> 
> 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

Reply via email to