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
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 ()
>
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
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
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