http://qs321.pair.com?node_id=217209

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

On my Solaris 7 unix.
I am trying to fetch a unique name of html or htm owners. Basically get names of all our web authors and a total count.

From my "ls -l" I just need the owner of the html or htm file and get a person's name just once where I dont see two of the same names. For example if I get these names for all html or htm owners:
Jones Jones Smith Smith Richards
I only need unique names such as:
Jones Smith Richards
My attempt to do it in Perl:
#!/usr/local/bin/perl -w open STDERR, "> /dev/null" || die "Cant redirect standrd error: $!"; use File::Find; use strict; print "Web owners\n"; print "----------\n\n"; my $ct = 0; sub search { if( $_ =~ /\.html?$/) { $datetime = scalar(localtime(time)); my $name = $File::Find::name; open ( F, $name ) or die "$!: $name\n"; while(my $owner = <F>) { ($ownerid, $groupid) = (stat( "$owner" ))[4]; $ownerName = getpwuid($ownerid); { $ownerName{$1} = 1; } } close F; } } my $dirs = '/thisdirectory/directory'; find( \&search, $dirs)); foreach (keys %ownername) { print "$_\n"; } print "$ct\n";