Re: return, wantarray, hash goodness

2002-09-05 Thread Michael Fowler
On Thu, Sep 05, 2002 at 07:16:45PM -0400, Wiggins d'Anconia wrote: > if ( 1 > my_sub_that_returns ) { > # do something cool. > } > It seems like this case could go either way, that is, in some cases your > function could simply be returning a scalar value, say 0 for a failure > in the

Re: return, wantarray, hash goodness

2002-09-05 Thread Wiggins d'Anconia
John W. Krahn wrote: >>however I am unclear what the following is (or how >>Perl determines it, though this is less important for now if it will >>make my head hurt), >> >>if ( &call_sub_like_this ) { >>do something cool here >>} >> >>Is this void because I am not assigning the valu

Re: return, wantarray, hash goodness

2002-09-05 Thread Janek Schleicher
Wiggins D'Anconia wrote at Thu, 05 Sep 2002 02:58:45 +0200: > ... > Question 1: Is there a way to differentiate the return context between > "array context" and "hash context" from what I have seen there is just > one big "list context"?? > ... > ... You might also have a look to the CPAN mod

Re: return, wantarray, hash goodness

2002-09-04 Thread John W. Krahn
Wiggins D'Anconia wrote: > > A little background followed by a bunch of questions. > > I am working on old shoddy code written by someone else who was an > administrator not a developer, yikes, yeh I know bad place to be, but > hey they are paying me for this. > > I have a function that current

return, wantarray, hash goodness

2002-09-04 Thread Wiggins d'Anconia
A little background followed by a bunch of questions. I am working on old shoddy code written by someone else who was an administrator not a developer, yikes, yeh I know bad place to be, but hey they are paying me for this. I have a function that currently returns an array when it should be r