There are ways of doing that in Perl, but it's worse than picking your nose in public - don't do it.

If there is some aspect of the code I presented that you don't understand ask about it instead of thinking up ways to avoid it. I suspect you are having trouble with Perl's hashes. If you expect to spend any significant time writing Perl understanding Perl's hash (associative array) data type is critical to using the language well. See perldata for information about Perl's data types. There is a lot to take in there. Take it a little at a time. Back up to the start of a section when you hit a bit you don't understand right off. If something really doesn't make sense come back here and ask.

Thank you and you are absolutely right, I know what you wrote is right only I don't understand why yet and how.Thank you as well for shaping me to be a decent perl programmer who does not do the equivalent of picking his nose in public in perl:) I appreciate your help, I am going to study hashes now:P