Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: removing elements from an array

by hbm (Hermit)
on Aug 09, 2012 at 17:46 UTC ( #986562=note: print w/replies, xml ) Need Help??


in reply to removing elements from an array

Might your strings be numeric, or can you simply grep out non-digits?

@array = grep !/\D/, @array;

Otherwise, I'd grab every other like:

my $i; @array = grep ++$i%2, @array;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986562]
help
Chatterbox?
[choroba]: Yes, "tynovsky" there is my friend and ex-colleague, I needed to beat him at Fibonacci :-)
[Corion]: ;)

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2017-10-20 09:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (260 votes). Check out past polls.

    Notices?