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