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:
use 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;
}
...
The <STDIN>; after the print statement in
print Dumper \%items; <STDIN>;
in the for-loop just pauses output until you hit Enter so you are not overwhelmed by stuff. (NB: My personal favorite structured data dumper is Data::Dump, but Data::Dumper is core. :)
Give a man a fish: <%-{-{-{-<
|