Portál AbcLinuxu, 6. listopadu 2025 08:03
Řešení dotazu:
my $hash = {};
foreach my $item (@array) {
$hash->{$item}->{count}++;
}
$hash{$item}++ ?
my %hash místo my $hash
mapem, proč to neudělat takto:
my %counts=(map {($_, 0)} @arr);
keys %counts;
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.