in reply to Packages, references, & data hiding...
Since you seem to be pulling the results of this in a list context, your resulting array will contain something like this:return @{$self->{'identities'}}; } else { return undef;
Either way, a test of @array in a scalar context is going to get you a non-zero/true value either way. Get into the habit of calling return witn no arguments when you want to return a 'false' value. This will return undef in a scalar context and an empty list in an array context, giving you the results you're looking for.@success = ($identity1, $identity2, $identity3); @failure = (undef);
} else { return;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Packages, references, & data hiding...
by zzspectrez (Hermit) on Dec 04, 2000 at 01:14 UTC |