In your original script you had a line "use strict;". Did you remove that line? It does seem that way, because otherwise the line "@fields = sort (@ElencoCampi);" would have given an error because you are using the global variable @fields instead of a local variable generated with my.
If you add a line "print \@fields;" to your loop you will see the problem, the reference never changes, it is always the same. But you need a new variable in every iteration of the loop so that they point to different memory locations
Change that line to "my @fields = sort (@ElencoCampi);" and your problem should go away.
In reply to Re^9: Hash of Arrays or Arrays of arrays? and how proceed?
by jethro
in thread Hash of Arrays or Arrays of arrays? and how proceed?
by paride
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |