in reply to [SOLVED] Capture the make status
Yes, the vexing problem of chdir being global. Separate your commands, thus:
At the end of the block, the working directory will snap back to what it was before. If the directory cannot be changed, it throws an exception. runx as shown will throw an exception if the return code is not 0.use File::chdir qw($CWD); use IPC::System::Simple qw(runx); { local $CWD = '...'; runx [0], 'make', 'this'; }
In Section
Seekers of Perl Wisdom