Re: array question (newbie)
- From: "John W. Krahn" <someone@xxxxxxxxxxx>
- Date: Wed, 31 Aug 2005 04:03:40 GMT
Jerry Cloe wrote:
> 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.
Put the statement:
use warnings;
at the top of your program and perl will tell you which is correct.
John
--
use Perl;
program
fulfillment
.
- References:
- array question (newbie)
- From: Jerry Cloe
- array question (newbie)
- Prev by Date: FAQ 1.15 Where can I get a list of Larry Wall witticisms?
- Next by Date: Re: array question (newbie)
- Previous by thread: Re: array question (newbie)
- Next by thread: Re: array question (newbie)
- Index(es):
Relevant Pages
|