Arrow dereference operator question
- From: dunric29a@xxxxxxxxx (David Unric)
- Date: Thu, 31 May 2007 08:55:03 +0200
Based on perlref documentation arrow operator between brackets subscripts
may be omitted so the following code is valid:
@array = ( [1, 2], [3, 4] );
$element = $array[0][0]; # shorthand for $element = $array[0]->[0]
Could somebody explain why it causes syntax error when the above rule is
applied to returned value of a subroutine ?
sub mysub {
@array = ( [1, 2], [3, 4] );
return @array;
}
$element = (&mysub)[0][0]; # $elem = (&mysub)[0]->[0] is valid
------------------------------
syntax error at testarr.pl line 7, near "]["
- Follow-Ups:
- Re: Arrow dereference operator question
- From: Chas Owens
- Re: Arrow dereference operator question
- Prev by Date: Re: zero width lookahead match
- Next by Date: Re: Arrow dereference operator question
- Previous by thread: Modules for parsing emails
- Next by thread: Re: Arrow dereference operator question
- Index(es):