#!/usr/bin/perl my $term = 'foo'; my @ary = qw/one foo another foo too many foos/; # print elements and addresses before print "$_->[0] => $_->[1]\n" for map {[$_ => \$_]} @ary; for (my $i = 0 ; $i < @ary ; $i++) { splice @ary, $i, 1 and @ary - $i and redo if $ary[$i] eq $term; } # print elements and addresses after print "\n"; print "$_->[0] => $_->[1]\n" for map {[$_ => \$_]} @ary;