Currently we have the very useful __SUB__ constant which points to the current sub. Might it not be also helpful to have an __ARRAY__ constant which would point to the current array as shown in the last line below:
use v5.34;
use warnings FATAL => qw(all);
my @i = 1..10;
say STDERR @i[0..$#i/2]; # 12345
say STDERR @i[0..$#__ARRAY__/2]; # Global symbol "@__ARRAY__" requires explicit package name
Currently we have the very useful
__SUB__
constant which points to the current sub. Might it not be also helpful to have an__ARRAY__
constant which would point to the current array as shown in the last line below: