print("Before setting command: $path\n"); $cmd = "ldd $path"; print("Before running command\n"); ($stdout, $stderr, $exit_status) = capture { system($cmd); }; print("After running command\n");