exec 'perl -e "print map {qq!\t$_\n!}"',@_
will fail with ENOENT (No such file or directory) when @_ isn't empty. When using the multiple argument form of exec the first argument is to be the program to execute. There's no file named perl -e "print map {qq!\t$_\n!}", much less a program.
And when @_ is empty, you have a different problem. perl will run, but the shell will have replaced $_ with something else due to improper quoting.
The solution to both is:
exec 'perl', '-e', 'print map {qq!\t$_\n!}', @_
Are these the problems you were asking about?
PS — If you had a problem with exec, you should have checked what error exec returned.
In reply to Re: become another via exec in dispatch table
by ikegami
in thread become another via exec in dispatch table
by Discipulus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |