Re: Binding scalars to aggregates

2005-07-30 Thread Autrijus Tang
On Sat, Jul 30, 2005 at 09:40:11AM -0700, Larry Wall wrote: > Right, so I guess what really happens is ref autogeneration in that > case, and there's no difference between > > $x = @array; > $x := @array; > > Hey, who said anything about consistency? :-) Hm, not exactly. This form:

Re: Binding scalars to aggregates

2005-07-30 Thread Larry Wall
On Sat, Jul 30, 2005 at 05:17:29PM +0200, Ingo Blechschmidt wrote: : Hi, : : Larry Wall wrote: : > Except that you've rebound the container. Hmm, maybe the original : > binding is an error. : : what about: : : sub foo (Array $arrayref) {...} : : my @array = ; : foo @array; : : The

Re: Binding scalars to aggregates

2005-07-30 Thread Ingo Blechschmidt
Hi, Larry Wall wrote: > Except that you've rebound the container. Hmm, maybe the original > binding is an error. what about: sub foo (Array $arrayref) {...} my @array = ; foo @array; The binding used by the parameter binding code does not use the standard := operator then, right?

Re: Binding scalars to aggregates

2005-07-30 Thread Ingo Blechschmidt
Hi, Larry Wall wrote: > On Sat, Jul 30, 2005 at 02:33:15PM +0200, Ingo Blechschmidt wrote: > : my @array = ; > : my $arrayref := @array; [...] > : $arrayref = 42;# !!! 42 is not a Ref of Array > : > : Should the last line be treated as > : $arrayref = (42,); > : wh

Re: Binding scalars to aggregates

2005-07-30 Thread Larry Wall
Except that you've rebound the container. Hmm, maybe the original binding is an error. Larry

Re: Binding scalars to aggregates

2005-07-30 Thread Larry Wall
On Sat, Jul 30, 2005 at 02:33:15PM +0200, Ingo Blechschmidt wrote: : Hi, : : my @array = ; : my $arrayref := @array; : : push $arrayref, "c"; : say [EMAIL PROTECTED]; # a b c d, no problem : : $arrayref = []; : say [EMAIL PROTECTED]; # d e

Binding scalars to aggregates

2005-07-30 Thread Ingo Blechschmidt
Hi, my @array = ; my $arrayref := @array; push $arrayref, "c"; say [EMAIL PROTECTED]; # a b c d, no problem $arrayref = []; say [EMAIL PROTECTED]; # d e f, still no problem $arrayref = 42;# !!! 42 is not a Ref of Array Sho