in reply to Re: Re: Newbie needs help replacing files in a directory
in thread Newbie needs help replacing files in a directory
I'm assuming you are on Windows, otherwise I'd suggest doing this without perl. I'm not even sure that I understand what you want. I think you want something like this...
#!/usr/bin/perl -w use strict; use File::Copy qw( cp ); opendir D, '.'; my @files = grep /\.html$/, readdir( D ); for ( @files ) { next if $_ eq 'new.html'; cp $_, "$_.bak"; cp 'new.html', $_; }
-sauoq "My two cents aren't worth a dime.";
|
|---|