in reply to Re: Perl cp -p?
in thread Perl cp -p?

Or you could use File::stat:

use File::stat; $st = stat($file) or die "No $file: $!"; my $mode = $st->mode; my $uid = $st->uid; my $gid = $st->gid;

A few more lines (or not, if you just use $st->field directly), but the extra typing makes up in clarity and not having to do a perldoc -f stat to figure out where each attribute is in the results.

-b