in reply to Run shell script in perl

A ikegami said, . and system are different, but it looks like you do not appreciate what either do.

The shell 'dot' command . (also known as 'source' in Bash and C shell) asks the current shell to execute the shell statements within the specified file. There are ways to do the same thing with Perl, but only with Perl statements (although Perl does allow inline statements from languages like C and Java). You only need read access on the file being used, since the shell is reading the statements as if you were typing them in. The most common reason for using the 'dot' command is to set environment variables in the current shell. The syntax for doing this in shell and Perl are very different, so even if you did do this in Perl it wouldn't work.

When you run a script from a shell, for example by typing ./script_name you will see that you need execute access on the script because it will run in another process. That is also what system does, and yours might be failing because of permissions (try chmod u+x script_name), or because the file is not in a directory which is in the PATH environment variable (echo $PATH, or specifiy the current directory). Any environment variables set in this way will only affect the new process - child processes run with a sort of filewall around them so they do not accidentally clobber anyone else.

You do not say what your error message is, nor do you say why you are executing the 'dot' command. If you did then we might be able to help further.