http://www.perlmonks.org?node_id=173921


in reply to .bat and perl mystery

t-cmd.pl:

#!/usr/bin/perl use strict; use warnings; $|++; my $cmd = 'hello world.bat'; my @cmd_args = qw/ testing testing 1 2 3 /; my $exit_code = system( $cmd, @cmd_args ); print 'exit code from ', $cmd, ' is ', $exit_code, $/;
and 'hello world.bat':
echo hello world! echo %1 %2 %3 %4 %5
does this work? system returns the exit code from the command. use backticks or qx// to get the program's STDOUT into a scalar or array.

~Particle *accelerates*