mofo has asked for the wisdom of the Perl Monks concerning the following question:
my $meglimit=10; my $debug=1; my $daylimit='15'; my ($user, $name, $homedir, $total, $matched); open(IGUSERS, "$workdir/ignoreusers") || die "cannot open ignoreuser +s file: $!"; open(PASSWD, "passwd") || die "cannot open passwd file: $!"; while(<PASSWD>) { chomp; $matched=2; ($user, $name, $homedir)=(split /:/)[0,4,5]; print "$user-$name-$homedir\n"; foreach my $iguser (<IGUSERS>) { print "running foreach\n"; chomp ($iguser); if ($iguser eq $user) { print "MATCHED-$iguser with $user\n"; $matched=1; last; } else { print "MATCH FAILED-$iguser with $user\n"; $matched=0; } } print "stuff\n"; if ($matched==0) { chdir "$homedir" || die "cannot chdir to $homedir: $!"; my $rawtotal=`du -smc * |grep total` || die "failed: $!"; print "DEBUG: Scanned - $user\n" if $debug==1; $rawtotal =~ m/([0-9]+)/; $total = $1; if ($total > $meglimit) { print "DEBUG: $user exceeded cap: $total\n" if $debug==1; #&checkdb(); #¬ify(); #&updatedb(); } } else { print "something\n"; } print "looping\n"; } close(PASSWD); close(IGUSERS); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with 'last' or problem with me?
by btrott (Parson) on Oct 10, 2000 at 23:35 UTC | |
|
Re: Problem with 'last' or problem with me?
by Fastolfe (Vicar) on Oct 10, 2000 at 23:29 UTC | |
|
Re (tilly) 1: Problem with 'last' or problem with me?
by tilly (Archbishop) on Oct 10, 2000 at 23:44 UTC | |
|
(Guildenstern) RE: Problem with 'last' or problem with me?
by Guildenstern (Deacon) on Oct 10, 2000 at 23:31 UTC | |
|
Re: Problem with 'last' or problem with me?
by ChOas (Curate) on Oct 11, 2000 at 11:07 UTC |