Index of element 'PINEAPPLE' is: 5 Index of element 'GRAPE' is: 3 Index of element 'ORANGE' is: 1 Index of element 'APPLE' is: 0 Method 2 (uses hash): $VAR1 = 'APPLE'; $VAR2 = 'ORANGE'; $VAR3 = 'GRAPE'; $VAR4 = 'PINEAPPLE';