foreach $array_element (@input_array) { my ($href_text, $href_directory) = split /=/, $array_element; ### now take off the leading and trailing double quotes ### my $href_dir_no_quotes = ""; if ($href_directory =~ /^"(.*)"$/) { $href_dir_no_quotes = $1; } }