in reply to deleting array elements(efficiency/critique)
Change the first and last lines to point to your object's list and you're all set. There may be better ways to do this, but this works.my @list = ('foo', 'bar', undef, 'batz'); my @clean_list; for (@list) {if (defined) { push (@clean_list, $_); } } @list = @clean_list;
|
|---|