Re: Perl 6 (was: Re: Confusion on @array vs $array[] vs $array)

2002-12-20 Thread Todd W
"Fliptop" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > [reply cc'd to list] > > On Thu, 19 Dec 2002 at 06:23, Rob Richardson opined: > > RR:What is the advantage of these changes? > RR:When is Perl 6 due out? > RR:Do those links you provided describe all the

Re: Perl 6 (was: Re: Confusion on @array vs $array[] vs $array)

2002-12-20 Thread Todd W
"Fliptop" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > [reply cc'd to list] > > On Thu, 19 Dec 2002 at 06:23, Rob Richardson opined: > > RR:What is the advantage of these changes? > RR:When is Perl 6 due out? > RR:Do those links you provided describe all the

Re: Confusion on @array vs $array[] vs $array

2002-12-20 Thread Todd W
"Fliptop" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > On Wed, 18 Dec 2002 at 13:49, kevin christopher opined: > > kc:Hope this doesn't further belabor the issue, but just to put my > kc:two cents in, Perl syntactic rules for prefixing "$", "@", "%" are > kc:

Re: Perl 6 (was: Re: Confusion on @array vs $array[] vs $array)

2002-12-19 Thread fliptop
[reply cc'd to list] On Thu, 19 Dec 2002 at 06:23, Rob Richardson opined: RR:What is the advantage of these changes? RR:When is Perl 6 due out? RR:Do those links you provided describe all the differences we will see in RR:Perl 6? i'm no authority on perl 6, so i can't answer any of your questi

Re: Confusion on @array vs $array[] vs $array

2002-12-19 Thread fliptop
On Wed, 18 Dec 2002 at 13:49, kevin christopher opined: kc:Hope this doesn't further belabor the issue, but just to put my kc:two cents in, Perl syntactic rules for prefixing "$", "@", "%" are kc:very consistent, IMHO: You just need to keep in mind the types of kc:the values/data types ultimate

Re: Confusion on @array vs $array[] vs $array

2002-12-19 Thread kevin christopher
Hope this doesn't further belabor the issue, but just to put my two cents in, Perl syntactic rules for prefixing "$", "@", "%" are very consistent, IMHO: You just need to keep in mind the types of the values/data types ultimately being expressed, and it should become clearer. "$" always prefixe

Re: Confusion on @array vs $array[] vs $array

2002-12-19 Thread Anthony Early
And, for increased flexibility (strict/warn OK) my @array = ( 10,20,30,40); my %array = @array; my %hash = (1,2,3,4); my @hash = %hash; print "Array Element \$array[1] = $array[1]\n"; print "Hash Element \$hash{'1'} = $hash{'1'}\n"; print "Array Hash Element \$array{'10'} = $array{'10'}\n"; p

RE: Confusion on @array vs $array[] vs $array

2002-12-18 Thread Scot Robnett
hree" # You can't have another "key2" key, # but the same -value- can be # associated with multiple keys if # desired. - Scot Robnett inSite Internet Solutions [EMAIL PROTECTED] -----Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROT

Re: Confusion on @array vs $array[] vs $array

2002-12-18 Thread Mark Bergeron
I can see where you're coming from on this. However the most obvious reason is that perl has no relationship in scalar context between @somename and %somename. Your question regarding the "special" $ is not germane to this concept. Each element of the array is a separate scalar variable, accesse

Re: Confusion on @array vs $array[] vs $array

2002-12-18 Thread WilliamGunther
In a message dated 12/18/2002 12:13:38 PM Eastern Standard Time, [EMAIL PROTECTED] writes: > > Anyway, perhaps one of you syntactical thought police could give me some > insights to the rational. I find it very confusing that the $ and @ > characters > are supposed to be used interchangeably

Re: Confusion on @array vs $array[] vs $array

2002-12-18 Thread Octavian Rasnita
@var is an array $var is a scalar $var[0] is also a scalar even though is an array element. @var[0] is an array which contains more array elements, but in this case it contains just a single element. To create an array slice with more elements, you'll need something like @var[0 .. n] You need to

RE: Confusion on @array vs $array[] vs $array

2002-12-18 Thread Scot Robnett
My understanding is that it's simpler than that. @ means list and $ means scalar, and essentially one element in a list is really a scalar. $foo[0] gets you the first scalar from the list @foo. $count = scalar(@foo); gets you a count of all the elements in the list. At least to me the @/$