Re: question on reference to array slice
- From: Gunnar Hjalmarsson <noreply@xxxxxxxxx>
- Date: Mon, 30 Jul 2007 01:02:23 +0200
Mirco Wahab wrote:
John W. Krahn wrote:$data[ 0 ] = [ \@nums[ 0 .. 9 ] ];
$data[ 1 ] = [ \@nums[ 10 .. 19 ] ];
This usage of slice reference is something I
didn't consider. So Bellovins word was right
again: "any software problem can be solved by
adding another layer of indirection."
"anonymous slice reference"
AFAIU, they don't really refer to the slice, but rather to arrays which in turn refer to the individual elements.
C:\>perl -MData::Dumper -e "@nums=1..20;print Dumper [ \@nums[0..9] ]"
$VAR1 = [
\1,
\2,
\3,
\4,
\5,
\6,
\7,
\8,
\9,
\10
];
C:\>
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.
- References:
- question on reference to array slice
- From: Rick
- Re: question on reference to array slice
- From: John W. Krahn
- Re: question on reference to array slice
- From: Mirco Wahab
- question on reference to array slice
- Prev by Date: Re: Perl with DBI
- Next by Date: Re: question on reference to array slice
- Previous by thread: Re: question on reference to array slice
- Next by thread: Re: question on reference to array slice
- Index(es):