Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^4: Avoiding repeated undefs

by rsFalse (Hermit)
on Feb 27, 2019 at 22:41 UTC ( #1230638=note: print w/replies, xml ) Need Help??

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 (Archbishop) 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]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1230638]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2020-01-24 03:00 GMT
Find Nodes?
    Voting Booth?