in reply to Re^2: insert element into an array
in thread insert element into an array

Once again you're splicing the wrong array :) If you want to remove a row, then you want to alter the outer array, @R.

But in this case, splice is really the wrong tool. Here you probably want to use grep.

#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my @R = ([qw(x y z)], [qw(a b c)], [qw(e f g)], [qw(h i j)]); print Dumper \@R; @R = grep { $_->[0] ne 'a' } @R; print Dumper \@R;
--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re^4: insert element into an array
by Anonymous Monk on Nov 19, 2004 at 10:20 UTC
    Many thanks for your reply