note
NetWallah
Inside "double quotes", the "\" character (which is the 'escape' character) needs to be escaped, using "\\".<p>
So, your foreach should read:
<c>
foreach(@files) {
system("c:\\midicsv\\midicsv.exe", "c:\\midicsv\\newmidi\\$_", "c:\\midicsv\\newcsv\\$_")
}
</c>
This shows the mixing of a variable with a path, answering your first question.<p>
For renaming files, you need to separate the pieces of the name, and replace the last piece.<br>
This is typically done using regular expressions, but you can also use "split".<p>
Here is a simplified example of replacing a trailing "csv" with "mid":
<c>
my $file = "C:\\temp\\somefile.csv";
my $midfile = $file; # copy it
$midfile =~ s/\.csv$/.mid/i;
</c>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-159887">
<p> <small>
"By three methods we may learn wisdom: First, by reflection, which is noblest; Second, by imitation, which is easiest; and third by experience, which is the bitterest."
-Confucius
</small></p>
</div></div>
1003055
1003055