santanudas
Technical User
Hi guys,
How can I determine the position of an array element if the value is known? For example, if we have
Then print $sss[3] will return “Wednesday”
I just need to do the other way round, i.e. if I know the element “Wednesday” then how can I return 4?
Thanks in advance. Cheers!!!
How can I determine the position of an array element if the value is known? For example, if we have
my @sss = qw(Sunday Monday Tuesday Wednesday Thursday);
Then print $sss[3] will return “Wednesday”
I just need to do the other way round, i.e. if I know the element “Wednesday” then how can I return 4?
Thanks in advance. Cheers!!!