JohnRS has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks. I seek your wisdom.
I'm writing a program on Windows 7 using Strawberry Perl 5.12.3. I'm having a problem using two modules which give me no trouble on Linux.
IPC::System::Simple (v1.21) doesn't seem to work.
use IPC::System::Simple qw(capture capturex system systemx run runx $E +XITVAL EXIT_ANY); # This fails. system('dir', 'test.pl');
autodie (v2.11) uses IPC::System::Simple, but if (and only if) you have explicity loaded IPC::System::Simple, then you can avoid the problem by temporarily disabling autodie. But you also lose the advantage of having it, at least while it is disabled.
use autodie 'system'; # This works. no autodie 'system'; system('dir', 'test.pl'); use autodie 'system'; # This fails. system('dir', 'test.pl');
The error I'm seeing is: "dir" failed to start: "The system cannot find the file specified" at C:/strawberry/perl/vendor/lib/IPC/System/Simple.pm line 480.
According to CPAN both these modules are supposed to work on Windows and are widely used. So I'm guessing that there is something that I'm overlooking. I did try the tests on another Windows machine and got the same results.
Thanks, JohnP.S. autodie's lexical feature doesn't seem to work on Windows, also. I didn't try it on Linux.
|
|---|