in reply to another way to split with limit

I seem to remember that split quits splitting when it runs out of places to put things.

$_= "p:e:r:l"; ($p,$e)=split(/:/);

split would assign p to p e to e read in r and then stop scanning the string at that point.

So putting in the limit is not needed since split will quit scanning after filling all the requested space. Of course if you split into an array the entire input string would be scanned and split as expected.

And you don't need to tell split to split $_ since that is the default thing to split.