Hello mrityunjaynath,
To elaborate a little on Anonymous Monk’s answer: the call to `qcmd.bat $toplevelentity` is itself “interpolated and then executed as a system command with /bin/sh or its equivalent.” (perlop) The standard output of this command is then passed to system, which attempts to run this “command” (whatever it is) as another system call. As Anonymous Monk says, you need double quotes (or qq()) here, not backticks (qx()). Alternatively, drop the call to system and just use the backticks:
if ($choice eq "y") {
`qcmd.bat $toplevelentity`;
}
else {
But note that, in this case, the (standard) output of the system call will be thrown away, unless you explicitly assign it to a variable or print it. If you call system, standard output goes to the console and only the command’s exit status is returned to the Perl script.
Hope that helps,