d4vis has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl -w use strict; open (FH, "userlist") || die "no userlist: $!"; open (FH2, ">output") || die "no output file: $!"; while (<FH>) { chomp; my $file = ("/usr/home/$_/INBOX"); my $maxsize = (30000*1024); if (-s $file) { my $size = (stat $file)[7]; my $meg = int ($size / 1024000); if ($size > $maxsize) { printf "%25s %3sMB\n", $_,$meg; print FH2 "$_:$meg\n"; } } } close (FH) || die "couldn't close userlist: $!:"; close (FH2) || die "couldn't close output: $!";
The chunk works just fine, but I'd like suggestions on how to make it better/stronger/faster, etc...
Is this even the right approach?
What do you think?
-thanks
~monk d4vis
#!/usr/bin/fnord
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: more ways to filesize
by jeffa (Bishop) on Aug 06, 2002 at 00:44 UTC | |
|
Re: more ways to filesize
by tstock (Curate) on Aug 06, 2002 at 00:30 UTC | |
by graff (Chancellor) on Aug 06, 2002 at 02:24 UTC | |
by theorbtwo (Prior) on Aug 06, 2002 at 01:22 UTC | |
|
Re: more ways to filesize
by DamnDirtyApe (Curate) on Aug 06, 2002 at 05:33 UTC | |
|
Re: more ways to filesize
by sauoq (Abbot) on Aug 06, 2002 at 00:54 UTC | |
by Chmrr (Vicar) on Aug 06, 2002 at 01:05 UTC |