in reply to Re^2: removing an element without index
in thread removing an element without index

This would be as succinct, more accurate, and a bit faster:

@data = grep $_ ne '4', @data; # Remove elements equal to '4'

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
RIP an inspiration; A true Folk's Guy

Replies are listed 'Best First'.
Re^4: removing an element without index
by roboticus (Chancellor) on Aug 10, 2010 at 12:54 UTC

    BrowserUk:

    It's not equivalent, though. I don't know if it would suit Levex's requirements or not, but it would give different results than the parent post if 14 or "BA4" were in the list of data.

    ...roboticus

      It's not equivalent, it would give different results than the parent post if 14 or "BA4" were in the list of data.

      Deliberately so. Hence "more accurate". I see nothing in the OPs post suggesting he wanted to remove multiple similar items; just one item.