in reply to Re: File remaing and removal to a subdirectory
in thread File renaming and removal to a subdirectory
I have enclosed the actual script used FYI
It went right through and printed the last line, but the files in C:/ Xwords had not changed their name.
#!/usr/bin/perl -w use strict; my $dir = "c:/Xwords"; my $from = '.puz'; my $to = 'A.puz'; while (<$dir*$from>) { my ($old,$new); $old = $new = $_; $new =~ s/$from$/$to/; rename $old, $new; } print "Files renamed !";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: File remaing and removal to a subdirectory
by tachyon (Chancellor) on Jul 12, 2001 at 11:13 UTC |