in reply to problem running executable in subdirectories

For one thing you never change back to the initial (or main) directory. Do you have to change to that directory or can you just run "foo.exe" from the starting directory ie:

`./$_/foo.exe`

What platform are you writing this for? The commands you are running suggest a linux/unix platform but running a *.exe suggests Windows.

Lastly, (and I understand that this is perlmonks.org so props for using Perl) you might want to look into using a shell scripting language (such as bash).

Replies are listed 'Best First'.
Re^2: trouble with a simple script
by ikegami (Patriarch) on Jul 07, 2010 at 19:16 UTC

    For one thing you never change back to the initial (or main) directory.

    The script's directory never changes, only the child's, so that's not true. The only major problem in the OP's code is the extra "`" that prevents the script from even compiling. Also, if he's using cmd (i.e. not a cygwin build), ";" must be changed to "&".

    Lesser problems include lack of error checking, lack of proper conversion from strings to shell literals, and possibly useless use of backticks.

    Update: Added lesser problems.
    Update: He's not on Windows as I believed.