Re: RFC 212 (v1) Make length(@array) work

[email protected] (Nathan Torkington) Wed, 13 Sep 2000 08:19:25 -0600 (MDT)
Newsgroups perl.perl6.language.subs
Message-ID <[email protected]>
Bart Lateur writes:
> Indeed. What about lists?
> 
> 	print length(qw(a b c));
> 
> Should this return 3?

It prints what this would print:

  $x = qw(a b c);
  print length $x;

The parser will check the first character of length's argument.  If
it's an @ sign, then it calculates the length of the array that is
the argument (and there should be only one argument--no commas).

Nat