in reply to Help to improving my code please?

You can use a hash of arrays structure:
$file_name =~ /^[A-Z]/i; push @{$arrays->{$1}}, $infoline;
This way all the dispatching is done by the hash not by ifels switching. Then you need to know how to use it:
for $key (keys %$arrays){ for $element (@{$arrays->{$key}}){ print $element; } }
Read more about this subject in perldoc perlre.