slok has asked for the wisdom of the Perl Monks concerning the following question:

have any of u come across any sysadmin scripts for listing usage of disk space by top users done only in Perl? ie no calls to "du" etc.. thining of working on one... but I have difficulties starting as I'm new to Perl.
  • Comment on disk usage script done only in Perl w/o system call

Replies are listed 'Best First'.
Re: disk usage script done only in Perl w/o system call
by merlyn (Sage) on Apr 13, 2001 at 19:37 UTC
    Well, the first part is probably something like:
    use File::Find; my %blocks_by_user; find sub { my @stat = lstat; $blocks_by_user{$stat[4]} += $stat[12]; }, "/";
    Does that help get you started?

    -- Randal L. Schwartz, Perl hacker

      thanks a lot...
      will read up more on File::Find.