in reply to Re^2: delete array element from array ref
in thread delete array element from array ref

Better would be:

@{$listref} = grep {exists} @{$listref};

Update: this is of course complete bolix as pointed out by tinita++.


Perl reduces RSI - it saves typing

Replies are listed 'Best First'.
Re^4: delete array element from array ref
by tinita (Parson) on Aug 23, 2008 at 19:17 UTC
    @{$listref} = grep {exists} @{$listref};
    maybe you meant:
    @{$listref} = map { exists $listref->[$_] ? $listref->[$_] : () } 0 .. $#{$listref} ;
    ?

    update: typo