Re: for $arrayref {...}

2005-09-02 Thread Juerd
Luke Palmer skribis 2005-09-01 23:43 (+): I would probably say that scalars never automatically dereference. It's lists and hashes that automatically dereference/enreference. arrays That is, everything is a scalar, really, but if you have an @ or a % on the front of your variable, that

Re: for $arrayref {...}

2005-09-02 Thread Luke Palmer
On 9/2/05, Juerd [EMAIL PROTECTED] wrote: Luke Palmer skribis 2005-09-01 23:43 (+): I would probably say that scalars never automatically dereference. It's lists and hashes that automatically dereference/enreference. arrays Yes, arrays, right. That is, everything is a scalar,

multisub.arity?

2005-09-02 Thread Ingo Blechschmidt
Hi, multi foo ($a) {...} multi foo ($a, $b) {...} say foo.arity; # die? warn and return 0? warn and return undef? return 1|2? --Ingo -- Linux, the choice of a GNU | There are no answers, only generation on a dual AMD | cross-references. Athlon!|

Re: multisub.arity?

2005-09-02 Thread Larry Wall
On Fri, Sep 02, 2005 at 05:56:39PM +0200, Ingo Blechschmidt wrote: : Hi, : : multi foo ($a) {...} : multi foo ($a, $b) {...} : : say foo.arity; : # die? warn and return 0? warn and return undef? return 1|2? How 'bout undef but 1..2? :-) Larry

undef but 1..2?

2005-09-02 Thread Ingo Blechschmidt
Hi, Larry Wall wrote: On Fri, Sep 02, 2005 at 05:56:39PM +0200, Ingo Blechschmidt wrote: : multi foo ($a) {...} : multi foo ($a, $b) {...} : : say foo.arity; : # die? warn and return 0? warn and return undef? return 1|2? How 'bout undef but 1..2? :-) Interesting,

Re: for $arrayref {...}

2005-09-02 Thread Yuval Kogman
On Fri, Sep 02, 2005 at 09:24:52 +0200, Juerd wrote: sub foo (@bar) { ... } foo $aref; Here $aref is dereferenced because of the Array context. The scalar can't do this by itself, of course. my @bar := $aref; -- () Yuval Kogman [EMAIL PROTECTED] 0xEBD27418 perl