in reply to Misinterpretation of File::Copy
If you want to keep it pure perl (but non perl cpio solution ++ :-), you could do the following:for my $i(@contents) { if ( -f "$from/$i" ) { copy("$from/$i","$to/$i"); } }
my( $uid, $gid ) = (stat $i)[4,5]; copy "from/$i", "$to/$i"; chown $uid, $gid, "$to/$i" or die "chown $to/$i (uid=$uid, gid=$gid) + failed: $!";
Pretty please with sugar on top, check your fscking return codes, okay? ([tm] Reservoir Dogs).
--
|
|---|