Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Remove elements from an array

by bibo (Pilgrim)
on Nov 23, 2004 at 17:59 UTC ( [id://409946]=note: print w/replies, xml ) Need Help??


in reply to Remove elements from an array

Assign an empty string... $foo[1] = ();

how's that? --bibo UPDATE: no that's really wrong. ignore....

Replies are listed 'Best First'.
Re^2: Remove elements from an array
by ikegami (Patriarch) on Nov 23, 2004 at 18:04 UTC
    That doesn't remove any elements, it just undefines an element. (splice(@foo, $i, 1) removes element $i.) Also, you didn't address finding the elements that don't "contain a certain string".

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://409946]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 22:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found