array question (newbie)
- From: "Jerry Cloe" <tom@xxxxxxxxxxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 03:49:13 GMT
Having an array:
@mylist=("apples", "oranges", "bananas");
And refering to a particular element, which syntax is correct? (or are both
correct)?
print "Item 2 is $mylist[1]\n";
or
print "Item 2 is @mylist[1]\n";
Both seem to work, and looking at other code, I see it done both ways.
.
- Follow-Ups:
- Re: array question (newbie)
- From: Paul Lalli
- Re: array question (newbie)
- From: A. Sinan Unur
- Re: array question (newbie)
- From: John W. Krahn
- Re: array question (newbie)
- From: Simon Taylor
- Re: array question (newbie)
- Prev by Date: Re: problem about the perl code. thanks for any comments
- Next by Date: Re: array question (newbie)
- Previous by thread: Using Win32::Process::Create with multiple child processes.
- Next by thread: Re: array question (newbie)
- Index(es):
Relevant Pages
|