2 ms·
Yea, using slices can accomplish this too. But if you're going to be using slices or a fixed number of elements on the left hand side you should also be using
by simcop2387 8y ago
Yea, using slices can accomplish this too. But if you're going to be using slices or a fixed number of elements on the left hand side you should also be using the third argument to split($delim, $input, $count) to tell split to only produce so many outputs. If the input string would split into more than two pieces in your original code you would end up overflowing into @arr4 and losing results from the second split.
- perl4ever 8y agoMaking it robust or sensible presumes there's some sort of coherent intent behind it, which was already disclaimed in the blog post.