foreach my $key ( keys %DB_data){ if ($key =~ /PWD/){ $sipPW = $_; } }