Andrew Gaffney <[EMAIL PROTECTED]> wrote: : : Charles K. Clarkson wrote: : > : > I don't understand what result you want to assign to : > the original array ref. Give us an example of what you want : > to end up with and we can get you there. : > : > Starting with this: : > : > : my $array1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, : 13, 14, 15]; : > : > End up with: : > : > $array1 = ??? : > $array2 = ??? : > $array3 = ??? : : I was just using those as temporary variables. Basically, I : want to end up with an array that is [0, 1, 2, 3, 4, 5, 7, 8, : 9, 10, 11, 12, 13, 14, 15] (missing the 7th element in this : case). I'm just trying to figure out how to remove an : arbitrary element from an array and not leave an empty space.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper 'Dumper'; my $array1 = [0 .. 15]; print Dumper $array1; splice @$array1, 6, 1; print Dumper $array1; __END__ HTH, Charles K. Clarkson -- Mobile Homes Specialist 254 968-8328 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>