The context in which a subscript is evaluated is no longer controlled
 by the sigil either.  Subscripts are always evaluated in list context.
+(More specifically, they are evaluated in a variant of list context
+known as I<slice> context, which preserves dimensional information
+so that you can do multi-dimensional slices using semicolons.  However,
+each slice dimension evaluates its sublist in normal list context,
+so functions called as part of a subscript don't see a slice context.
+See S09 for more on slice context.)


So a function can only supply values for one dimension?  Given
  @array[foo;bar]
each function is called in list context and returns a list for one of the 
dimensions.  But what if you wanted a function to replace the literal subscript 
in:
  @array[1,2;1;3]
  @array[foo]  # what does foo return to be equiv to the first line?
My guess is that I could write
  @array[@@ foo]
or in a mixed example
  @array[1;@@ foo;2]  # foo returns (1;1)

In any case, examples such as these would help.

--John

Reply via email to