Jonathan Scott Duff wrote:
>
> On Thu, Aug 03, 2000 at 10:02:44AM -0400, Tad McClellan wrote:
> >
> > On Thu, Aug 03, 2000 at 10:53:02AM +0100, Hildo Biersma wrote:
> >
> > > If functions could distinguish between
> > > 'wantarray' and 'wanthahs' this would be easy to do.
> >
> >
> > Due to the recent "rename local()" and "can't return an array"
> > discussions here, we should also consider "rename wantarray()"
> > as well.
> >
> > It should be named wantlist()
>
> Well, perhaps we should rename it to whatdoyouwant() :-)
> Or perhaps you prefer the shortened version, want()?
>
> if (want eq 'hash') { return %hash }
> elsif (want eq 'array') { return @{$hash{vector}} }
> elsif (want eq 'scalar') { return $hash{vector]->[0] }
> elsif (want eq 'handle') { return $hash{filehandle} }
>
> /me patiently awaits all those RFCs (or are we calling them PCRs now,
> and won't that confuse the biotechnologists?) from Damian Conway.
Why not context()?
if (context eq 'hash') { return %hash }
elsif (context eq 'array') { return @{$hash{vector}} }
elsif (context eq 'scalar') { return $hash{vector]->[0] }
elsif (context eq 'handle') { return $hash{filehandle} }
--
Clayton Scott
Nortel Networks