develooper Front page | perl.perl6.language.data | Postings from August 2000

Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping

Thread Previous | Thread Next
From:
Daniel Chetlin
Date:
August 26, 2000 01:46
Subject:
Re: RFC 148 (v1) Add reshape() for multi-dimensional array reshaping
Message ID:
20000825233017.B22617@ilmd.chetlin.org
On Fri, Aug 25, 2000 at 07:35:24PM -0700, Nathan Wiger wrote:
> > > > $a[$i][$j][$k] or $a[$i,$j,$k]
>
> > The second one has no useful meeting, "," is just an operator which
> > does nothing much useful in this context.
> 
> Not true, at least not in the Perl I know. :-) Here's a description of
> what these do in Perl just to clarify:
> 
>    $a[0][1][2];      # get a single multidimensional element
>    $a[0,1,2];        # get elements 0, 1, and 2 of @a

perl -le'@a=(1..5);$,=" .. ",print @a[1,2,3];print $a[1,2,3]'
2 .. 3 .. 4
4

perl -wle'@a=(1..5);$,=" .. ",print @a[1,2,3];print $a[1,2,3]'
Multidimensional syntax $a[1,2,3] not supported at -e line 1.
Useless use of a constant in void context at -e line 1.
2 .. 3 .. 4
4

-dlc


Thread Previous | Thread Next


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