in reply to Finding index of an entry in an Array

my $input = $ARGV[0] || 'bar'; my @repo = qw (foo bar qux); map{ print $_ if $repo[$_] eq $input } 0..$#repo;

Don't put off till tomorrow, what you can do today.