#!/usr/bin/perl -w use strict; use Data::Dumper; my @array = qw( 1 2 3 4 5 6 7 ); foreach my $element ( @array ) { # Doing tons of stuff here to test element # Multiple DB Calls. For sake of testing, we'll only # test for even numbers. # Can I print the element number of the array here? # Delete element here if it matches. delete element being evaluated if it's even. } # Should print an array with all odd values. print Dumper \@array;