Perl search in array

This Perl example is a function where I search for an element in an array, it returns the position or -1 if nothing matches.

As result we get for 9 -> 3 and for 4 -> -1 seems good.

4 thoughts on “Perl search in array”

  1. Right here is the right website for everyone who wishes to find
    out about this topic. You know a whole lot its almost hard to argue with you
    (not that I actually will need to…HaHa). You certainly put a brand new spin on a subject that has been discussed for years.
    Great stuff, just great!

    View Comment

Leave a Reply

Your email address will not be published.

20 − six =