gary.stainb...@ringways.co.uk (Gary Stainburn) writes:
> On Thursday 03 September 2015 18:19:57 Marius Gavrilescu wrote:
>> The above can be shortened using the Sort::Key module.
>>
>> use Sort::Key 'nkeysort';
>> for my $key (nkeysort { $pagetypes{$_}
sort.
for my $key (sort { $pagetypes{$a}{seq} <=> $pagetypes{$b}{seq} } keys
%pagetypes) {
# do stuff with $pagetypes{key} here
}
The above can be shortened using the Sort::Key module.
use Sort::Key 'nkeysort';
for my $key (nkeysort { $pagetypes{$_} } keys %page
27;,'1902-6','1902-7','1902-8');
my %hash;
for (@arr) {
my ($earfcn, $pcid) = split /-/;
next unless $pcid; # Skip the NULLs
$hash{$earfcn} //= [];
push @{$hash{$earfcn}}, $pcid;
}
for my $earfcn (keys %hash) {
say "EARFCN=$earfcn,PCID=", join '&', @{$hash{$earfcn}};
}
--
Marius Gavrilescu
signature.asc
Description: PGP signature