in reply to Re^4: Sorting Data?
in thread Sorting Data?
Can you explain ...? I'd like to understand a little bit better ...
You can gain insight yourself into the operation of this (or any) program by inserting print/dump statements at strategic points to see how data is extracted and transformed and how structures are built up:
The <STDIN>; after the print statement inuse Data::Dumper; ... my %keys; while(<DATA>) { push @secondpass, $_; $keys{$_}++ for /SATID (\d\d)/g; } print Dumper \%keys; my @keyorder = sort keys %keys; print Dumper \@keyorder; for (@secondpass) { my %items = reverse /(SATID (\d\d).{27})/g; print Dumper \%items; <STDIN>; print join ' ', map { $items{$_} // ' ' x 35 } @keyorder; } ...
Give a man a fish: <%-{-{-{-<
|
|---|