Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

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]
[moritz]: good morning
[moritz]: perl -MNetAddr::IP -wE 'say NetAddr::IP->new( "2001:780:233::/ 64")->hostenum' dies with netmask error: overrange or spurious bits at -e line 1.
[moritz]: any idea what's wrong?

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (8)
As of 2017-04-25 07:32 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (449 votes). Check out past polls.