I would do as
Paladin suggested, put values into a hash. To print, I would declare an array with the correct order that you want and then use that array in the main loop of a generalized print routine. Of course you might want to think about what happens if for some reason some desired key didn't wind up existing.
#!/usr/bin/perl
use strict;
use warnings;
$|=1;
# generated from the if regex statements instead of printing
# right away
my %values = ( 'Luma Mode' => 'D45_PRED',
'Chroma Mode' => 'UV_CFL_PRED',
'CFL' => 5,
'Luma Angle' => 3,
'Chroma Angle' => 0, );
my @order = ('Luma Mode', 'Luma Angle', 'Chroma Mode',
'CFL', 'Chroma Angle');
foreach my $key (@order)
{
print "$key:\t $values{$key}\n";
}
__END__
Luma Mode: D45_PRED
Luma Angle: 3
Chroma Mode: UV_CFL_PRED
CFL: 5
Chroma Angle: 0
Oh, I suppose that this code:
if ($line =~ /\s*APP>\sIntraAngleDelta\s:\s(\d+)\s(\d+)/i) {
print "Luma Angle : $1\n"
}
if ($line =~ /\s*APP>\sIntraAngleDelta\s:\s(\d+)\s(\d+)/i) {
print "Chroma Angle : $2\n"
}
Should be this??:
if ($line =~ /\s*APP>\sIntraAngleDelta\s:\s(\d+)\s(\d+)/i) {
$values{'Luma Angle'} = $1;
$values{'Chroma Angle'} = $2;
}