Re: Using the () list notation with $scalars

2004-07-01 Thread Rob Benton
John W. Krahn wrote: On Thursday 01 July 2004 14:30, Rob Benton wrote: I'm looking for a little help here. I'm not understanding exactly what's wrong with this code: === #!/usr/bin/perl -w use strict; open IN, " my %rows; while () { c

Re: Using the () list notation with $scalars

2004-07-01 Thread John W . Krahn
On Thursday 01 July 2004 14:30, Rob Benton wrote: > > I'm looking for a little help here. I'm not understanding exactly > what's wrong with this code: > > === > #!/usr/bin/perl -w > > use strict; > > open IN, " > my %rows; > > while () >

Re: Using the () list notation with $scalars

2004-07-01 Thread Gunnar Hjalmarsson
Rob Benton wrote: $rows{$fields[2]} = [ ($fields[3]..$fields[-1]) ]; Depending on what the fourth and last elements in @fields contain, that range can be very, very long... I think this is what you mean: $rows{$fields[2]} = [ @fields[3..$#fields] ]; -- Gunnar Hjalmarsson Email: http://www

RE: Using the () list notation with $scalars

2004-07-01 Thread Charles K. Clarkson
Rob Benton <[EMAIL PROTECTED]> wrote: : I'm looking for a little help here. I'm not understanding exactly : what's wrong with this code: : : === : #!/usr/bin/perl -w : : use strict; : : open IN, ") : { : chomp; : my @field

Re: Using the () list notation with $scalars

2004-07-01 Thread Jeff 'japhy' Pinyan
On Jul 1, Rob Benton said: > $rows{$fields[2]} = [ ($fields[3]..$fields[-1]) ]; You're doing two things wrong: the '..' operator needs to be INSIDE the subscript. @fields[$lower .. $upper] The other thing is that you can't do a range like that. If you want to get the elements from [3] t