I'm trying to write a Perl script that runs videos in a directory n
times on Windows Media Player one after the other.
For some reason, on the 64th video playing, it gets stuck on system(1, @commands)
.
Right now, the command is system(1, "C:\\Program Files (x86)\\Windows Media Player\\wmplayer", $path);
in the following for-loop.
for (my $i = 0; $i < $n; $i++)
{
# do stuff
# Play video
system(1, "C:\\Program Files (x86)\\Windows Media Player\\wmplayer", $path);
sleep $duration + 1;
# do stuff
}
I'm wondering why it keeps stopping at the 64th video (I've run this multiple times and it's always the 64th.) Maybe someone can explain system(1, @commands)
better to me? All I know is that it just doesn't wait for @commands
to finish before continuing the program...
Thanks a lot!