Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
402 B

#!/usr/bin/perl
use strict;
use warnings;
use Text::GenderFromName;
use 5.10.0;
my ($male, $female, $unknown) = (0, 0, 0);
while (my $name = <STDIN>) {
chomp $name;
my $gender = gender($name);
if (! defined $gender) {
$unknown++;
next;
}
if ($gender eq 'm') {
$male++;
} elsif ($gender eq 'f') {
$female++;
}
}
say "male: $male, female: $female, unknown: $unknown";