Re: Aliasing an array slice

2003-07-18 Thread Benjamin Goldberg
David Storrs wrote: > > Thinking about it, I'd rather see lvalue slices become a nicer version > of C. > > my @start = (0..5); > my @a = @start; > > @a[1..3] = qw/ a b c d e /; > print @a; # 0 a b c d e 4 5 What would happen if I used 1,2,3 instead of 1..3? Would it do

Re: Aliasing an array slice

2003-07-18 Thread Luke Palmer
> David Storrs wrote: > > > > Thinking about it, I'd rather see lvalue slices become a nicer version > > of C. > > > > my @start = (0..5); > > my @a = @start; > > > > @a[1..3] = qw/ a b c d e /; > > print @a; # 0 a b c d e 4 5 > > What would happen if I used 1,2,3 instead

Re: Aliasing an array slice

2003-07-18 Thread Benjamin Goldberg
Luke Palmer wrote: > > > David Storrs wrote: > > > > > > Thinking about it, I'd rather see lvalue slices become a nicer version > > > of C. > > > > > > my @start = (0..5); > > > my @a = @start; > > > > > > @a[1..3] = qw/ a b c d e /; > > > print @a; # 0 a b c d e 4 5 > > >

Re: Aliasing an array slice

2003-07-18 Thread Dave Whipp
"Luke Palmer" <[EMAIL PROTECTED]> wrote: > Benjamin Goldberg wrote: > > David Storrs wrote: > > > @a[1..3] = qw/ a b c d e /; > > > print @a; # 0 a b c d e 4 5 > > > > What would happen if I used 1,2,3 instead of 1..3? Would it do the same > > thing? > > Of course. I tend to agree, I

Re: Aliasing an array slice

2003-07-18 Thread Benjamin Goldberg
Dave Whipp wrote: > "Luke Palmer" wrote: > > Benjamin Goldberg wrote: > > > David Storrs wrote: > > > > @a[1..3] = qw/ a b c d e /; > > > > print @a; # 0 a b c d e 4 5 > > > > > > What would happen if I used 1,2,3 instead of 1..3? > > > Would it do the same thing? > > > > Of course. >

Re: Aliasing an array slice

2003-07-18 Thread Luke Palmer
Benjamin Golberg writes: > Luke Palmer wrote: > > > > > David Storrs wrote: > > > > > > > > Thinking about it, I'd rather see lvalue slices become a nicer version > > > > of C. > > > > > > > > my @start = (0..5); > > > > my @a = @start; > > > > > > > > @a[1..3] = qw/ a b c d e /; >