Is there a way I can open a new cmd window and pass a variable and once completed close that window?
I have found some info but not enough that I can get it to work.
system('start "List Perl files" dir c:/dfd/dfdf.pl /B');
Opens window but does not开发者_如何学C run script.
Main script:
my ($x, $y) = (888, 999);
system('start', 'List Perl files', 'perl', 'other_script.pl', $x, $y);
The other script:
print "Args received = @ARGV\n";
<STDIN>;
BTW, there's probably a better way to achieve your larger goals -- for example, organizing the needed functionality into modules. Passing information from one script to another via command-line arguments and @ARGV
can be a hassle and a limiting factor.
精彩评论