You just need to create your mp3 player as a pipe from perl. For example:
$| = 1; # Set unbuffered output. open( my $mp3player, "| mpg123" ) or die "cannot start mp3 player: $!"; print $mp3player "s"; ... print $mp3player "q"; close $mp3player
Second attempt for multiple script calls: in the interactive shell, enter tty . This will give you a pseudo terminal name. Now run the player in this shell. In another shell, write to this pseudo-terminal. For example. echo "s" > /dev/pts/11 . The player will receive this as an input. If this works, use your perl script instead of echo to write to the pseudo terminal.
Peter G.
source share