in reply to Re^3: Avoiding repeated undefs
in thread [Solved] Avoiding repeated undefs

The split behavior here really looks like a bug. Limit "inheritance" is not documented, so it is a surprise for user.

UPD.: Thanks, choroba, somehow I missed that line :( . Now it seems normal behaviour. But in case '(split ... )[ ... ]' it doesn't look like DWIM, when split generates too few elements (which cant't be accessible by higher indexes which were used).

Replies are listed 'Best First'.
Re^5: Avoiding repeated undefs
by choroba (Cardinal) on Feb 28, 2019 at 06:42 UTC
    If what you mean by "inheritance" is

    > when assigning to a list, if LIMIT is omitted (or zero), then LIMIT is treated as though it were one larger than the number of variables in the list;

    then note that the quote was taken directly from the documentation of split.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]