File-Find-ProjectCycleMigration
view release on metacpan or search on metacpan
lib/File/Find/ProjectCycleMigration.pm view on Meta::CPAN
# write to the original and get the file mode.
my ( $mode, $uid, $gid ) = ( stat($currentFile) )[ 2, 4, 5 ];
# write out a new file.
if ( not( open OUTFILE, ">$currentFile" ) ) { die("Error opening file: $!"); }
print OUTFILE $wholeFileString;
if ( not( close(OUTFILE) ) ) { die("Error closing file: $!"); }
# set the file mode.
chmod( $mode, $currentFile );
chown( $uid, $gid, $currentFile );
open( FILE, ">>$logFile" ) || die "cann't open the $!\n";
print FILE "---------------------------------------------\n";
print FILE "$replaceCount replacements made at\n";
print FILE "$currentFile\n";
close FILE;
}
}
find( \&processFile, $folderPath );
open( FILE, ">>$logFile" ) || die "cann't open the $!\n";
( run in 1.034 second using v1.01-cache-2.11-cpan-5511b514fd6 )