Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Removing elemets from an array

by LanX (Chancellor)
on Dec 28, 2012 at 13:07 UTC ( #1010702=note: print w/replies, xml ) Need Help??

in reply to Removing elemets from an array

And for completeness, the hash slice approach:

(Nota bene: repeated array elements will be deleted)

DB<109> @arcb = ( 450, 625, 720, 645 ); => (450, 625, 720, 645) DB<110> @arca = ( 625, 645 ); => (625, 645) DB<111> @arcb{@arcb}=(); => (undef, undef, undef, undef) DB<112> @arca{@arca}=(); # EDIT: ehm ... sorry useless line... + => (undef, undef) DB<113> delete @arcb{@arca} => (undef, undef) DB<114> @arcb=keys %arcb => (450, 720)

Cheers Rolf

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1010702]
[Discipulus]: .. yes erix until NodeReaper put jhon coltrane again
[erix]: nice cover with the spitting image of George (and a great solo by Prince at the end )
[Discipulus]: good night monks! i feel fresh as the turkey in the hoven but i need to sleep
[planetscape]: gobble, gobble, Discipulus!
[erix]: Discipulus: buonanotte! :)
[stonecolddevin]: man we need a new guitar legend
[stonecolddevin]: Clapton has issues playing nowadays
[stonecolddevin]: Prince is gone
[stonecolddevin]: Van Halen is still around but I haven't heard any of their new stuff
[erix]: oh, 41M views -- everyone has seen it already then :)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-06-22 21:18 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (531 votes). Check out past polls.