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

Re: Skipping Elements in an Array

by Taulmarill (Deacon)
on Apr 07, 2005 at 08:29 UTC ( [id://445573]=note: print w/replies, xml ) Need Help??


in reply to Skipping Elements in an Array

how about this?
for (0..$#Array){ next if length $Array[$_] == $num_of_skip; print "$Array[$_]\n"; # do some other cool stuff }

Replies are listed 'Best First'.
Re^2: Skipping Elements in an Array
by monkfan (Curate) on Apr 07, 2005 at 08:39 UTC
    Hi Taumarill,

    Thanks for the reply. But:

    1. In your snippet each element is "still evaluated", the intention is "not" to evaluate skipped element.

    2. Length of array element may or "may not" be equal to $num_of_skip.
    Regards,
    Edward

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2024-04-18 14:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found