in reply to Re^3: What is the difference between $array[1] and @array[1]?
in thread What is the difference between $array[1] and @array[1]?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: What is the difference between $array[1] and @array[1]?
by ikegami (Patriarch) on Apr 07, 2009 at 17:09 UTC | |
by JavaFan (Canon) on Apr 07, 2009 at 21:21 UTC | |
by ikegami (Patriarch) on Apr 07, 2009 at 22:30 UTC | |
|
Re^5: What is the difference between $array[1] and @array[1]?
by Porculus (Hermit) on Apr 07, 2009 at 20:05 UTC | |
by JavaFan (Canon) on Apr 07, 2009 at 21:26 UTC |