Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Foreach loop

by PetreAdi (Acolyte)
on Sep 27, 2013 at 09:55 UTC ( #1055951=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    $substr = " 1 ";
    foreach $key ( @newarray ){ 
    if (index($key, $substr) != -1) {print "\nExist";}
  2. or download this
    @newarray[n]="5    10    14    16    17    20    25    26    38  1  42
    +    47    54";

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1055951]
Front-paged by Arunbear
[karlgoethebier]: He!
[Eily]: Discipulus pretty much all oneliners are killing. Do you imagine how many people could be working if you asked them to do the same thing in C each time ? :P
Eily is Listening to "Leave out all the rest" by Linkin Park
[karlgoethebier]: that's why trade unions like C ;-)

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (10)
As of 2017-07-21 09:25 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (320 votes). Check out past polls.