http://qs1969.pair.com?node_id=1189986


in reply to Re^2: Is it possible to execute some command in qx argument
in thread Is it possible to execute some command in qx argument

$arg = "$(mkdir otherdir1)";
Use single quotes in Perl, or the "$(" won't stick. And do something that produces output as well, to use in the name of the new directory.
$arg = '$(mkdir otherdir1; date +%F_%H.%M.%S)';
This also shows the need to cleanup (AKA "untaint") the user entered input data before just executing it. You could be executing a lot more than you bargained for.