#!/usr/bin/perl use strict; use warnings; my @coins = ("twenty","thirthy","fourthy"); my $key; my $value; my ($index) = grep($coins[$_] eq "fourthy", 0 .. $#coins); print "\nthe index of 'fourthy' is " . $index . "\n"; my @index2 = grep($_ ne "fourthy", @coins); print "\nnone 'fourthy' elements are " . join(",",@index2);