Hi,
I couldn't seem to find a built-in function for finding the index
of an element in an array...so I wrote this one:

--------------------------------------------------------------------

#  position_of returns the position of a string in an array of strings,
#  and -1 if the string is not a member of the array.

sub position_of {
   my ($x,@y) = @_;
   foreach $z (0..$#y) {
      if (@y[$z] eq $x) {
         return ($z);
      }
   }

   return -1;
}
----------------------------------------------------------------------

it works.... but somehow i feel there's a built in function for this

thanks.

_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: 
http://photos.msn.com/support/worldwide.aspx


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to