Do you honestly think in terms of lists when you do $a[4]? I don't.Neither do I. But that's not the point. The issue is, what do you think when you see @a[4]? The sigil makes me think "list". It turns out to be a one element list. Good. Nothing wrong with that. IMO.
But Perl warns. It thinks there might be a problem.
I can't figure out what you think I was saying, but hopefully this clears it up.I cannot figure out whether you think that it's good that Perl warns about @a[1] or that you think it shouldn't warn, but it gives the programmer the freedom to signal the intent to use a list.
In reply to Re^4: What is the difference between $array[1] and @array[1]?
by JavaFan
in thread What is the difference between $array[1] and @array[1]?
by vinoth.ree
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |