Yes, you can run them through the system command
use strict; use warnings; my @commands; push(@commands, ['dir', '*.*', '/ad', '>', 'file1.txt']); push(@commands, ['dir', '*.*', '>', 'file2.txt']); push(@commands, ['dir', '*.*', '/b', '>', 'file3.txt']); foreach (@commands) { my $command = $_; system(@$command); if ($? == -1) { print "[Error] Failed to execute: [$!]\n"; } elsif ($? & 127) { printf "[Error] Child died with signal %d, %s coredump\n", ($? + & 127), ($? & 128) ? 'with' : 'without'; } else { printf "Child exited with value %d\n", $? >> 8; } } print "Done\n";
I've created an example script for you to start to work from and you can add your own commands once you have tested this initial script to get it working.
In reply to Re: running exe files of windows with pearl
by tokpela
in thread running exe files of windows with pearl
by perlprint
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |