Use a hash. Something like the following
This is untested.# opening of files etc. my %users = (); while ($line = <errlog>) { chomp $line; next unless ($line =~ /Login succeeded/); $users{(split / /, $line)[6]} ||= 1; } foreach (sort keys %users) { print LOGINF $_, "\n"; } # closing fhs etc
NB: consider using lexical filehandles.
hth,
regards,
tomte
An intellectual is someone whose mind watches itself.
-- Albert Camus
In reply to Re: array processing
by Tomte
in thread array processing
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |