Often I need to sort file by length of lines and always I can't remember code which is doing this.
my @elements;
while(my $line = <>){
push @elements, $line;
}
@sorted = sort { length $a <=> length $b } @elements;
foreach my $l (@sorted){
print($l);
}
nice post
ReplyDeletePenyebab Penyakit Miom