sub cmd($@) { my $self = shift; my @cmd = @_; ## Make sure none of them contain newlines for (0 .. $#cmd) { $cmd[$_] = [split "\n", $cmd[$_]]->[0]; } ## Join words with spaces and send them to linphonec print {$self->{Writer}} join(' ', @cmd) . "\n"; }