in reply to How do I completely remove an element from an array?

Well this is a little bit of a goose chase because you didn't quite give enough specifics and I am new to perl, but I think I know. It really depends what the element is and where it is. You can use "pop" and "shift" to my knowledge. I don't know what "splice" is quite yet. Anyway good luck! Oh, and if you want to know where to find out about "pop" and "shift" look at Learning Perl 3rd Edition near the end of chapter 3.

-<STDIN>

  • Comment on Re: How do I completely remove an element from an array?

Replies are listed 'Best First'.
Re: Answer: How do I completely remove an element from an array?
by Bukowski (Deacon) on Oct 19, 2002 at 10:45 UTC
    splice:

    splice ARRAY, OFFSET, LENGTH, LIST

    removes the elements designated by OFFSET and LENGTH and replaces them with the contents of LIST

    Also you'd be wise not to forget delete which deletes an element (or a slice of elements) from a specified hash or array.

    Bukowski - aka Dan (dcs@black.hole-in-the.net)
    "Coffee for the mind, Pizza for the body, Sushi for the soul" -Userfriendly