in reply to Re: insert element into an array
in thread insert element into an array
but this just removes everything (including the line I want to delete) up to the end of the arrayfor my $rc (@R) { if ($rc->[0] eq "a") { splice @$rc, 0, 2; } }
This works but then when I try to print the array out I get an uninitialized value in concatenation error.for my $rc (@R) { if ($rc->[0] eq "a") { delete $rc->[0-2]; } }
foreach (@records) { $buf .= "$_->[0] $_->[1] $_->[2] $_->[3]\n"; print $buf; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: insert element into an array
by davorg (Chancellor) on Nov 18, 2004 at 15:24 UTC | |
by Anonymous Monk on Nov 19, 2004 at 10:20 UTC |