in reply to the command - system ( "source ./profile") not working

i get this error

Which error is that then? 'source' is a built-in to csh or bash to read and execute a file without creating a child process, 'pwd' is a built-in shell command, so I'm not surprised you get an error. What is it you are trying to do? If you want to get the current working directory use Cwd.

Using another program, like a shell, to do simple stuff like that is like employing someone else to tie your shoe laces - expensive and slow.
  • Comment on Re: the command - system ( "source ./profile") not working

Replies are listed 'Best First'.
Re^2: the command - system ( "source ./profile") not working
by Anonymous Monk on Apr 12, 2013 at 22:14 UTC
    The problem is that you are trying to execute "source" which is not a real program. It is a bash builtin command. Try the following: my $XYZZY=`bash -c "source SOME-FILE; DO WHATEVER"`;