in reply to from array to hash

Like previous posters have said use splice(@arr, $off, $len) to delete items from your lists, though if you can't use slice then you will have to test for definedness yourself. Example:
my @a = qw( a b c d ); # delete a & c splice(@a, 0, 1) splice(@1, 1, 1)
As for converting the array into a hash while preserving the previous contents something like this will do the job nicely:
my @a = qw( a b c d ); my %b = ( 'e' => 2 ); %b = (%b, map { $_ => 1} grep defined, @a);
This preserves the previous contents of %b while adding keys for @a into %b.