in reply to File/Dir Attributes

Yep, you want to look at the stat builtin function:

my $filename = $ARGV[0]; + my ( $dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks ) = stat($filename); + print "UID: $uid\nGID: $gid\n";

/J\

Replies are listed 'Best First'.
Re^2: File/Dir Attributes
by onegative (Scribe) on Jun 21, 2005 at 19:01 UTC
    Very KEWL!!! Thanks a ton, that just made it so much easier to do what I am wanting to do. Thanks again gellyfish, You ROCK!

      I showed all of the values returned from stat for didactic purposes - if you just want the UID and GID you would be better to use an array slice:

      my ($uid,$gid) = (stat($filename))[4,5];

      /J\

Re^2: File/Dir Attributes
by shekarkcb (Beadle) on Aug 03, 2009 at 15:18 UTC
    Hi

    Is there anything which equals to Unix 'file' command?

    Thanks,
    ShekarKCB