Happy Monday! I can't believe I am having this problem, but then it IS Monday.
There is a function, index(), that performs what I need without a for-if combo, but this works for strings.
I need an index() function for an array:
my @array = ( 'Blue', 'Red', 'Green', 'Yellow' );
#I want to know what will return the Position of 'Red' in @array:
my $element_position = array_index('Red');
#in other words, what would set $element_postition to 1?
Randy Mitchell, Jack of all ITrades
There is a function, index(), that performs what I need without a for-if combo, but this works for strings.
I need an index() function for an array:
my @array = ( 'Blue', 'Red', 'Green', 'Yellow' );
#I want to know what will return the Position of 'Red' in @array:
my $element_position = array_index('Red');
#in other words, what would set $element_postition to 1?
Randy Mitchell, Jack of all ITrades