in reply to Getting the UID of a file

Or (for the OO inclined), there is:
use File::stat; # yes, that's a lower-case s print stat($file)->uid;

Replies are listed 'Best First'.
Re: Re: Getting the UID of a file
by Hofmator (Curate) on Jan 09, 2004 at 12:15 UTC

    but beware of the BUGS:

    As of Perl 5.8.0 after using this module you cannot use the implicit $_ or the special filehandle "_" with stat() or lstat(), trying to do so leads into strange errors. The workaround is for $_ to be explicit my $stat_obj = stat $_; and for "_" to explicitly populate the object using the unexported and undocumented populate() function with CORE::stat(): my $stat_obj = File::stat::populate(CORE::stat(_));

    -- Hofmator