#!/usr/bin/perl use strict; use warnings; my @array = qw/21 33 5 49 235 40/; my @index = grep {$array[$_] == 235} 0..$#array; print "@index\n";