-foreach (keys %$current) {
- my $ids = $current->{$_}->{Id};
- foreach (keys %$ids) {
- MPD::exec("deleteid", $_);
- }
-}
-
-MPD::exec("command_list_end");
-while (<$sock>) {
- last if /^OK$/;
- die($_) if /^ACK/;
-}
+MPD::exec("deleteid", $_) foreach (map { @$_ } values %$current);
+MPD::run("command_list_end");