Bryan R Harris wrote at Wed, 29 May 2002 01:36:23 +0200:
> Is it possible to return elements 2 (index 1) > thru end of the results of a split? > > @myarray = (split(/\s+/,$fContent[$i]))[1..-1]; > > seems right, but doesn't work... > The problem of your code is that 1 .. -1 is an empty list for perl. So you have to use the splice command directly (the [x...y] form is only a shortcut for) my @array = splice( @{[split( /\s+/, $fContent[$i] )]}, 1 ); There's a second possibility, which one is a little bit shorter and trickier: my @array = grep {$foo++} split ( /\s+, $fContent[$i] ); Of course I only use it one liners, because it hides what you are really doing, what's always a sign of bad programming. However TMTWTDI. Hope, I could help you, Best Wishes, Janek -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]