X-Git-Url: https://git.draconx.ca/gitweb/mpdhacks.git/blobdiff_plain/b0f5f5741b234174958ade58a6e884df8b6b00e4..4fec499ce726a2dad91c05e2cd69566b31d9d15a:/MPDHacks.pm diff --git a/MPDHacks.pm b/MPDHacks.pm index 94c0acc..0f5026e 100644 --- a/MPDHacks.pm +++ b/MPDHacks.pm @@ -107,4 +107,12 @@ sub escape { return $s; } +# Submit a command to the MPD server; each argument to this function +# is quoted and sent as a single argument to MPD. +sub exec { + my $cmd = join(' ', map { MPD::escape } @_); + + print $sock "$cmd\n"; +} + 1;