App-RegexFileUtils
view release on metacpan or search on metacpan
share/ppt/cp.pl view on Meta::CPAN
my $path2show = $target;
$path2show =~ s|^$cp::CWD|.|;
print STDERR "cp: overwrite $path2show (yes/no)? ";
my $response = <STDIN>;
return if ($response !~ /^y/i); ## not this one
}
print "cp $path $target\n" if $VERBOSE;
open(PATH, "<$path") or die "Unable to read $path: $!";
open(TARGET, ">$target") or die "Unable to create $target: $!";
if ($cp::BINMODE) { binmode PATH; binmode TARGET; }
my $buffer;
while (read PATH, $buffer, 1024) { print TARGET $buffer; }
close PATH;
close TARGET;
if ($PRESERVE) ## preserve as many file attributes as possible...
{
my($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) = stat $path;
utime $atime, $mtime, ($target);
chown $uid, $gid, ($target);
( run in 0.506 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )