for my $tone (@tones) { my @hz = map { 2 * $pi * $_ } @{$dtmf{$tone}}; add_tone(@hz); }