This renames and copies the file but only the name of the file, not what it contains. Would you provide some help here? I'm using Windows XP.#!/bin/perl #usage: #C:\Perl>perl Replace_chars_of_files.pl "C:/Perl/" use warnings; use strict; use File::Copy; my $path = $ARGV[0]; die "You must supply a full directory path" unless (-e $path && -d $pa +th); my @dirs; opendir(DIR, $path) || die "can't opendir $path: $!"; my @fileet = grep { -f "$path/$_" } readdir(DIR); closedir(DIR); foreach my $file (@fileet) { $file =~ s/ä/ä/g; $file =~ s/ö/ö/g; move($file, "$path/$file"); }
In reply to Renaming files in dir by larus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |