in reply to Array naming difference @name @{'name'}
I try to access the array named @name, by @{'name'} or by using variable @$var where $var='name'.
This is almost always not a good idea, as is explained in this article (Update: Oh, I just saw holli already linked to it). These kinds of questions are usually most easily solved by storing the data in a hash, in this case the structure would be a hash of arrays (link includes sample code, and as the AM showed). At the very least you probably want to use hard references (my $arrayref = \@name;) instead of symbolic ones - see perlreftut and perlref, as kcott said.
so far I have no other choice to use @{'name'} from beginning of my program
Could you show a Short, Self-Contained, Correct Example of this?
|
|---|