Flat Earth Catalogue

2018-04-12

hard-won perl split knowledge
So ($a,$b,$c) = split '_', 'foo_bar__underscore_party_' doesn't work like you think, i.e. 'foo' eq $a and 'bar' eq $b and '_underscore_party_' eq $c. You know why? Because splitting into a list of length N is equivalent to a LIMIT argument of ... N+1. I.e. ($a,$b,$c) = split '_', 'foo_bar__underscore_party_', 4 which gets you 'foo' eq $a and 'bar' eq $b and '' eq $c. And it throws the 4th split away. UGH.
22:45

Powered by Blogger

 

(K) 2002-present. All rights reversed, except as noted.

Hard-won technical knowledge, old rants, and broken links from 10 years ago. I should not have to explain this in the 21st century, but no, I do not actually believe the world is flat.

Past
current