[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] wantarray() Function Question



On Wed, Jan 12, 2000 at 08:56:20PM -0800, Bruce Van Allen wrote:
> In response to a question from sleidy@voicenet.com:
> At 7:31 PM -0800 1/12/00, blm@halcyon.com wrote:
> >|my(@the_Time) = &hms();
> >|my($the_Time) = &hms();
> >
> >Read the "Private Variables via my()" section in perlsub.pod while thinking
> >about the above lines.
> >
> 
> But don't stare too hard at the 'my' part of it. The point is that having
> the scalar $the_Time in my's parentheses (at the time you assign the value
> from &hms() to it) makes it an element in an array, so wantarray() returns
> true...

To be precise...  The parentheses around $the_Time make it part of a list,
not of an array.  The builtin wantarry() was misnamed; it should have been
wantlist() instead.

Ronald

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org