develooper Front page | perl.perl6.language.subs | Postings from September 2000

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

From:
Nathan Torkington
Date:
September 13, 2000 07:21
Subject:
Re: RFC 212 (v1) Make length(@array) work
Message ID:
14783.36077.744043.775335@prometheus.frii.com
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



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About