Simple... use below line in the subroutine if you have used "use warnings" in the top of your programm.
no warning;
no warning;
sub executeCommand
{
my $command = join ' ', @_;
($? >> 8, $_ = qx{$command 2>&1});
}
my ($status, $output) = executeCommand ('/bin/ls', '/');