On Sep 9, 2014, at 2:57 PM, Shawn H Corey wrote:

> On Tue, 09 Sep 2014 23:09:52 +0200
> lee <l...@yun.yagibdah.de> wrote:
> 
>> my $i = 1;
>> my $f = 2.5;
>> my $s = 'string';
>> my $list = (1, 2, 3);
> 
> No, the count of items in the list gets stored in $list: $list == 3

Unless the thing on the right-hand-side of the assignment is a 'list' and not 
an 'array'. This is the one place I can think of where the distinction between 
'list' and 'array' actually makes a difference.

Compare this:

  my $n = ( 4, 5, 6 );

with this:

  my @a = ( 4, 5, 6 );
  my $n = @a;

(Don't try this with the list ( 1, 2, 3 ), either!)


--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to