exec
exec command
- Terminates the currently running Perl script and executes the program named in command. The Perl program does not resume after the
execunless theexeccannot be run and produces an error. Unlikesystem, the executed command is not forked off into a child process. Anexeccompletely replaces the script in its current process.command may be a scalar containing a string with the name of the program to run and any arguments. This string is checked for shell metacharacters, and if there are any, passes the string to
/bin/sh/ -cfor parsing. Otherwise, the string is read as a program command, bypassing any shell processing. The first word of the string is used as the program name, with any remaining words used as arguments.command may also be a list value where the first element is parsed as the program name and remaining elements as arguments. For example:
exec 'echo', 'Your arguments are: ', @ARGV;
Theexecfunction is not implemented for Perl on Win32 platforms.