Quick bit of Perl help (Windows)

Soldato
Joined
18 Jan 2006
Posts
3,178
Location
Norwich
Hiya,
Really ought to be able to figure this one out myself, but I'm a little stuck :p
I've got a perl script which automatically muxes all the AVI files in ints directory into MKV, which looks like this-
Code:
foreach (<*.avi>) {
  $cmd = "mkvmerge $_ -o ";
  s/\.avi$/.mkv/;
  $cmd .= $_;
  system($cmd);
}

What I want to do is add a cleanup segment to the script, so that it removes all the starting AVI files when its done. My initial thoughts would be that I need to run the first segment of the script in a loop, before switching to the cleanup part, but I can't seem to get it so that it knows its finished properly.

Cheers

-Leezer-
 
No, the first segment of original code is right :)
Yep, the second was a typo on my part, but it still works with it in place.

I've found my own problem though- Its spaces in file & directory names. I'll think about fixing this further later :p

-Leezer-
 
Last edited:
Yeah, I know, but this presents problems with the script itself; Its generating the command passed to the shell dynamically (And this is where the problem is), & it doesn't take kindly to having quotes shoved into it. Theres a simple way to fix this, I'm sure of it but not at this time in the morning!

-Leezer-
 
Back
Top Bottom