Vote count:
0
The following code gives the result of "Female4946Male5054gender1". How do I add spaces between the element and its number and why is it printing the array with a 1 next to it?
#!/usr/bin/perl
use strict;
use warnings;
my @gender;
my $female=0;
while ( <> ) {
chomp;
my @fields = split /,/;
push @gender, $fields[5];
}
my %count;
$count{$_}++ for @gender;
print %count;
asked 28 secs ago
How do you format the output of printing count
Aucun commentaire:
Enregistrer un commentaire