my $f;
Opendir($f,".");
my $filename;
while ($filename=readdir($f)) {
if ($filename=~/\.avi$/) {
$filename=~s/([ \[\];$'"()])/\\$1/g; #adds \ before spaces, bracke
+ts and other special chars
...
}
}
Note I do not know how escaping works in windows (where \ is dir separator) or what special chars make problems there. So above probably needs some more refinement to work on both platforms.
|