in reply to Re: System() in list mode?
in thread System() in list mode?

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re^3: System() in list mode?
by anneli (Pilgrim) on Oct 18, 2011 at 21:00 UTC

    Alright.

    Here I'm prepending $HOME/dir to PATH, and executing a program named "program name", which happens to be in /home/anneli/dir (i.e. the path I prepended):

    $ pwd /home/anneli $ ls -F ./dir/ program name* $ cat dir/program\ name #!/usr/bin/env perl print "It works!\n"; $ cat eg.pl system('env', "PATH=$ENV{HOME}/dir:$ENV{PATH}", 'program name'); $ perl eg.pl It works! $

    I hope this helps. We do the necessary expansion of HOME and PATH on our side, before sending them through to the (non-expanding) multi-argument system call.

    Anne